Code Monkey home page Code Monkey logo

Comments (3)

cessen avatar cessen commented on May 13, 2024 1

highly unusual
...
I think it's broken,

Not the author, but I disagree that it's broken or especially unusual. As just a couple of examples, Kakoune and Helix are both terminal-based editors that draw their own cursors.

Now, whether that's a preferable approach or not is certainly up for debate (and somewhat depends on use case--e.g you can't do multiple cursors with the tty cursor). But calling it broken and/or highly unusual seems hyperbolic to me.

from zee.

mcobzarenco avatar mcobzarenco commented on May 13, 2024

Thanks for issue -- indeed, zee uses the terminal in raw mode and disables the tty cursor.

I would love to help though, would you be so kind to go into some detail about what the issue is? Is it unexpected that the cursor doesn't look the same? Is it a styling consideration?


Raw mode with no tty cursor has many advantages, i.e. you get complete control over what's displayed on the screen + allows accurate incremental repainting that the tty cursor would interfere with. I did start by trying to use the tty cursor early on, but found it to be super limitative, buggy and causing it flickering when repainting incrementally. By painting my own cursor, the behaviour is cross-platform and works the same regardless of terminal emulator, as well as allow for correct handling of wide unicode graphemes or compound graphemes correctly (which most emaulators don't handle correctly most of the time), multiple cursors, box selection etc. etc. AFAIK, emacs does the same, but may have a config option not to..

For more context, the terminal is actually abstracted away, zee renders to a rectangular "canvas" containing of what I call "textel"s (i.e. a grapheme together with associated text styling and a background and foreground colors). This is handled by https://github.com/mcobzarenco/zi . The editor is not really aware of the backend we render to, one thing this will enable down the line is to support a GPU accelerated version, similar to how emacs' GUI verison.

from zee.

tommythorn avatar tommythorn commented on May 13, 2024

highly unusual; I can't think of a single example where when entering text, we aren't using the terminal cursor. The examples that spring to mind: bash (any shell really), nano, vi, emacs -nw, gpg. Examples without a cursor (but also aren't entering text): top, htop

It's literally the point of the cursor to point out were you are entering text. Arguing about customization is a very zee-centric view of the world - I don't want to have to customize it, I already customized the terminal and that covers all the interactive apps.

I think it's broken, but it's very easy to fix.

from zee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.