120 karma · joined Mar 30, 2011 (15y ago) · 26 submissions
comment 1y ago · link · parent
comment 1y ago · link · parent
Locales also bring in a lot more complicated sorting - so that could be a factor also.
comment 1y ago · link · parent
comment 1y ago · link · parent
1. The shell could have a keybind (say, ctrl+enter) which runs the command with (for example) only styling enabled (CSI m sequences).
2. You could write a wrapper around any program to do the same. The shell doesn't need to know anything about the system, but instead you have a wrapper that disables and then reenables said sequences.
3. A program itself can opt in by turning on the feature at launch. This allows CLI / TUI developers to "safeguard" their programs from malicious attacks.
comment 1y ago · link · parent
comment 2y ago · link · parent
I wrote a proposal[0] to have terminals send these updates in-band, instead of requiring polling a-la xterm. So far, foot, ghostty, iterm2, and kitty have implemented this feature on the terminal side. Neovim, notably, also supports this on the client side.
[0]: https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3...
comment 2y ago · link · parent
comment 2y ago · link · parent
I maintain two TUI libraries which use this technique and emoji support has been (nearly) great. (One of which uses your uniseg library!)
https://mitchellh.com/writing/grapheme-clusters-in-terminals
comment 2y ago · link · parent
Other than that, it's using standard ANSI sequences: `\r` to return the cursor to the beginning of the line, `\x1bM` (Reverse Index) to move the cursor up a single line (repeated n times), and then `\x1b[J` to clear the screen below the cursor position. All of these are sequences defined at least since the VT220, probably the VT100.
comment 2y ago · link · parent
All of that said, I am a huge proponent of the kitty keyboard protocol. I would love to live in a world where the "default" encoding of keys is done with the that protocol (with the disambiguate flag on)
comment 2y ago · link · parent
I disagree. The vast majority of terminals will send the same sequences. There is almost never a case where handling the two options for backspace the same way will result in a bad user experience. What complicates this even more is that many terminals allow the user to modify which sequence the `Backspace` key sends (0x08 vs 0x7F). Any application relying on terminfo, where a user did not modify their terminfo entry, will interpret these wrong if a user has manually changed it.
Terminfo is not needed anymore. It served a purpose to let applications know how to talk to a terminal. That era is gone.
comment 3y ago · link · parent
A(nother) golang TUI library. Targeting modern terminal features, and a few different APIs for building applications. I really like notcurses, but the CGO cost when setting individual cells is very high...so this was my attempt to "port" what notcurses does to go. I handle things a little differently than notcurses, but in general am taking a lot of the same approaches for finding out terminal capabilities. Just not nearly as many optimizations when it comes to the render side (but Vaxis can render at about 5000 FPS in typical cases, so I haven't tried to optimize anything more there than it already is).
The main design decision I am going back and forth on how much I have used globals. Initially the design was a big struct, but I liked being able to use globals so when I write widgets as part of the library, they can send messages into the event queue without needing access to an application struct or something. I can't think of a single use case where a user would need more than one instance, so globals have seemed fine (and even notcurses says you can have only one notcurses instance per process...so I'm not even straying from that).
Thanks for any feedback!
comment 3y ago · link · parent
The advantage of going straight to notmuch is that the data model is so similar to JMAP that synchronizing is just that much easier. Both ends can give you a state and all emails which have changed from that state. Then it’s just a matter of updating the tags on those to each end or uploading/downloading the email if it’s new.
I get something like 1.7kB round trip data usage when there are no updates (really it’s 0kB save for the keepalive when used in daemon mode) and ~100ms for that round trip. This is in comparison to several megabytes for a single mbsync poll (even when there are 0 changes) and ~5 seconds
comment 15y ago · link · parent
1) Perry's Handbook for Chemical Engineers (Perry)
2) Conceptual Design of Chemical Processes (Douglas)
Perry's is the end all be all for technical reference.
Conceptual Design is incredibly useful for learning how to quickly and accurately design an entire process. If anything, it'll teach you the best methods to go about "back of the hand" calculations for sanity checks.