9 ms·
State of the Terminal
- nicce 2y agoJust a shoutout how beautiful and powerful terminal editors can be if you invest some time to know the keybindings. There are some very powerful configurations and you don't need to invest that much time for configuration if you don't want to. Currently, if you like visuals and want super fast experience, one easy (my favorite) setup is to install neovim, nvchad.com and (as extra neovide.dev)
- eminence32 2y agoA quick off-the-cuff remark based solely on the title: in 2024, I think the state of the terminal has never been better, in large part to Microsoft making a high quality terminal easily available to everyone on Windows [1] As an application author, I love being able to assume that all major platforms have a good terminal and that my favorite terminal rendering libraries should Just Work on all of them [1] https://github.com/microsoft/terminal https://github.com/microsoft/terminal
- blueflow 2y agoI really dislike that they re-used the TERM value from xterm instead of getting their own merged into terminfo. And then not documenting which sequences are actually supported and which aren't.
- ranger_danger 2y agoThey have their own, and it's documented. https://invisible-island.net/ncurses/terminfo.src.html#tic-ms-terminal https://invisible-island.net/ncurses/terminfo.src.html#tic-m... Surely you can imagine that it takes years or more to get people to update though, so switching to a new entry right away could make for a bad user experience.
- blueflow 2y agoThat's not made by them and not supported by upstream, see full thread: https://lists.gnu.org/archive/html/bug-ncurses/2019-08/msg00000.html https://lists.gnu.org/archive/html/bug-ncurses/2019-08/msg00...
- tristan957 2y agoYou would be surprised how much software is built exclusively for TERM=xterm or TERM=xterm-*.
- dartos 2y agoWhich is exactly the root cause of terminal weirdness. Instead of a standard, we have mountains of terminfo entries which are mostly slight xterm variants and ancient hardware
- blueflow 2y agoI'm aware and i think its not okay. Its incorrect software. And yes, that difference is significant because the F-keys, Ins, End and companions won't work.
- revscat 2y agoYou're getting downvoted but you're not wrong. Using TERM=xterm-* should be deprecated, and in this case in particular that likely means stepping on some toes.
- Bjartr 2y agoIt's like the user agent string in browsers. Using that instead of checking for feature availability directly is always going to end up in a mess like this over time. Heck, there wasn't a Windows 9 because of how much software would break because they had `if (osversion.startswith("9"))` check to decide if it needs to act in pre-XP mode, long after XP itself was EOL. Most people aren't willing to give up functional workflows on principle alone. "stepping on some toes" massively understates the impact.
- hiccuphippo 2y agoSounds like the user agent string in web browsers.
- eej71 2y agoI mainly use microsoft terminal now just beacuse it did a better job handling more of the font decorations (italic was one that I recall). My one gripe though is that it seems like microsoft terminal is still kind of slow at scrolling. If I accidentally grep for something that spews a lot to the screen, terminal is just plain hung up a bit. And for many of us - but not everyone? - control-space in emacs is just kind of broken. Long standing open issue for that one.
- argulane 2y agoHave you turned on the new render engine in the microsoft terminal settings? It is marked beta but should be much faster.
- Longhanks 2y agoTrue, but no matter the terminal, you still have to deal with either cmd or PowerShell (and its horrendous startup time), "active code pages", and the fact that you cannot write UTF-8 to stdout without it getting messy - you need WriteConsoleW and/or SetConsoleOutputCP but that affects the whole environment, ... cli on Windows was and is painful.
- pjmlp 2y agoPowerShell 7.4.2 starts in 1s for me.
- Longhanks 2y agozsh starts in 0.1s for me. 1000ms is a very noticable latency to me...
- pjmlp 2y agoImagine how much work we would do with those additional ms per day.
- radonek 2y agoOnce upon a time, I was tasked to rewrite build scripts for windows based team from .bat files to bash scripts (via a git-bash). People on that team were not exactly unix fans, in fact they resisted hard almost everything coming from us linux weirdos. But reduction in build time was so big they asked for this and embraced it with genuine love.
- pjmlp 2y agoI bet it was a bit more than a few ms per day.
- zubairshaik 2y agoYou can run WSL or nushell on Windows Terminal
- pjmlp 2y agoYes, although thankfully on Windows we have a modern graphical terminal, with a scripting language that took plenty of learnings from non-UNIX CLIs into account.
- hiccuphippo 2y agoDoes this mean I can run the Build Your Own Text Editor[0] tutorial in Windows without WSL? I did it in Linux a few years ago, recently heard of Crossterm[1] and was thinking trying to remake it with that, but maybe it's not necessary? [0] https://viewsourcecode.org/snaptoken/kilo/ https://viewsourcecode.org/snaptoken/kilo/ [1] https://github.com/crossterm-rs/crossterm https://github.com/crossterm-rs/crossterm
- eminence32 2y agoCrossterm does indeed work well under Windows Terminal. I use it indirectly via the ratatui library[1] [1] https://github.com/ratatui-org/ratatui https://github.com/ratatui-org/ratatui
- _lvbh 2y ago> Modifier keys like Ctrl and Alt complicate this situation. This is such an understatement. Alacritty required you to manually bind keys to control characters in the config and finding the control characters escape sequences were such a nightmare I gave up and switched to foot
- jprete 2y agoThe wonkiness of modifier keys is a constant barrier whenever I try to do anything to make a terminal environment more ergonomic. In the end I always go back to 100% IDEs and GUI document editors.
- mixmastamyk 2y agoLooks like VTE finally fixed their bug regarding Ctrl+arrows etc. I have few issues now.
- joouha 2y agoDo any terminals support overprinting? This could radically change what is possible in TUIs
- yjftsjthsd-h 2y agoI don't know about overprinting per se, but you can already use whatever foreground+background colors you want; how much benefit would overprinting be?
- joouha 2y agoThis would allow more complex shapes to be drawn by combining multiple glyphs, which would be useful for complex TUI applications (there are only a limited number of box-drawing characters available) Also, this could allow drawing more than two colours per terminal cell.
- wonger_ 2y agoThat's an interesting idea. The closest thing I can think of is using an extended box-drawing font: https://hpjansson.org/blag/2024/01/18/chafa-1-14-all-singing-all-dancing/#:~:text=all%20the%20shapes%20you%20could%20ever%20want https://hpjansson.org/blag/2024/01/18/chafa-1-14-all-singing.... That doesn't solve the two-colors-per-cell challenge. But it makes for some very realistic terminal images. For higher fidelity rendering, I think the next best option is supporting image protocols like sixels or Kitty inline raster images. I'm not sure how overprinting would compare to existing options.
- joouha 2y agoI've just found that Mintty supports this https://github.com/mintty/mintty/wiki/CtrlSeqs#overstrike https://github.com/mintty/mintty/wiki/CtrlSeqs#overstrike
- yjftsjthsd-h 2y agoOh, like making arrows by overlaying - with > or ^ with |. I could see that.
- mg 2y agoThe terminal is such a wonderful environment. It makes many tasks joyful. I think it stems from its simplicity and logic. You have a simple grid of characters. You type the name of a program, hit enter, and the computer executes it. The output of the program is written below your prompt. Below the output, you can execute the next program. You can chain output and input of programs, allowing all kinds of data flows. The programs can also take over the whole grid and thereby allow all kinds of interfaces. I can't think of a way to describe a window manager or a browser in similar, simple terms, which would explain the basis of all the usefulness they bring.
- unshavedyak 2y agoAgreed. My only real problem is that font size and "UI" size (gutters/etc) being tied feels like an accessibility tax. Aside from that, they're wonderful. I wonder if we could eventually make a "new term" which shares the same foundation, but atop a rich rendered experience. A GUI written with simple primitives (that could also probably be rendered as TUI, frankly), but with slightly more slick (and expensive lol) rendering. I know, i know - blasphemy, i'm sorry. But despite my love for the Term (i've been in it for ~15 years now) i long for _slightly improved_ graphics.
- mbrumlow 2y agoIt’s called emacs.
- unshavedyak 2y agoI thought Emacs was primarily an editor? Not a general purpose shell, subshells, muxer, etc - not a terminal. I thought emacs would be a singular app? Eg it sounds like you're saying that Vim is the Terminal if Emacs is the thing i'm describing?
- skulk 2y agoEmacs seems to fit what you're describing pretty closely. It can render as a GUI and TUI even though the GUI can display things the TUI can't (like fonts/images)
- inguz 2y agoRetro-plug: here's a Teletype ASR33 simulator with sound https://www.youtube.com/watch?v=jd5oomwEBb0 https://www.youtube.com/watch?v=jd5oomwEBb0
- ilaksh 2y agoIt would be nice if more terminals other than xterm would support Tektronix vector graphics. https://github.com/bennetyee/TekGraphics https://github.com/bennetyee/TekGraphics Here's an emulator for those specific real terminals: https://github.com/rricharz/Tek4010 https://github.com/rricharz/Tek4010
- kergonath 2y agoI don’t really want vector graphics, but more support for sixels would be massively helpful.
- lambdaba 2y agoAre there any efforts to radically reimagine the entire "terminal" concept? Seems very limiting to advance further in the 21st century with those same 70's technical assumptions. [edit] I was thinking more in terms of being unconstrained by low-res displays, inability to display anything other than text, etc.
- ranger_danger 2y agoWhat do you suggest?
- geor9e 2y agoDifferent person here, but I wish there was a terminal where mouse clicks moved the text cursor (without holding any hotkey), mouse drags selected text and typing replaced the selected text, ctrl-A selected the entire current command (all the text after $ ), holding left/right arrow went WAY faster… Basically, if you know how to competently edit an email, you shouldn't struggle in frustration at editing a big terminal command. I believe that some day there will be a terminal app you can sit a kid down in front of, and they're be able to fix a typo without any frustration or special knowledge. That day hasn't yet come. I get the historical traditions for why terminal is the way it is, and I get why people who already know the secrets don't care to change it, but IMO it's time to move on.
- dartos 2y agoSome terminals support mouse input without any special modifier keys. I’ve used vim in iterm doing exactly that.
- joouha 2y agoIt's up to individual applications how they implement user input. All of this is entirely possible in modern terminal emulators - look at the micro text editor, for example. I guess most shells (bash, zsh, etc.) keep things "traditional" for backwards compatibility reasons.
- UI_at_80x24 2y ago
- joouha 2y agoThis is a nice summary. It would be good if there was more emphasis on graceful degradation in TUI libraries, such as falling back to ASCII art when terminal graphics are not supported. > Some new TUI libraries, such as vaxis, are designed specifically to avoid using terminfo at all and exclusively use queries to determine feature capabilities. I take this approach in euporie [1], having encountered the same issues with using terminfo as discussed. However, there were a few terminal features which I could not find a way to query - iTerm2 graphics support, for example. [1] https://github.com/joouha/euporie https://github.com/joouha/euporie
- 9dev 2y agoI could never really understand the enthusiasm. Why are we still dealing with over half a century of cruft? I get that this is a core piece of technology lots of stuff is built upon, and I'm not arguing to get rid of the classic terminal emulation altogether. But I wish there was an effort of building a new, modern, textual interface to computers with modern assumptions and integration bindings. We shouldn't need to be concerned with obscure escape sequences to print color; tooling shouldn't need to parse strings to do something useful; and junior developers shouldn't need to waste hours scrolling an obtuse man page until they resort to a half-assed SO response with broken parameters to extract a tar archive. There is more to shells and text interfaces than working within constraints set 50 years ago.
- dmd 2y agoThere are tons of efforts like that. https://xkcd.com/927/ https://xkcd.com/927/
- hnlmorg 2y agoThe problem is to break away from ANSI escape sequences and the like means also rewriting 50 years of command line tools. Like with the modern web, there’s just too much momentum behind the current design to make it practical to reinvent it from scratch That doesn’t mean that things cannot improve though. It just makes it massively more difficult if you want to retain backwards compatibility. And if you don’t, then people probably won’t adopt it because they won’t be able to get their job done, regardless of how good the UX is. As it happens, I am trying to solve these problems. In part with my alternative shell. To take your SO example, I’ve recently even playing around with integrating ChatGPT to help with hints (on top of automatic man page parsing which already happens). I’m also writing a new terminal emulator that aims to bring interactive widgets (like support for sorting and filling anything that looks like a table). But that term is very much alpha at the moment.
- pjmlp 2y agoOnly in regards to UNIX CLI tools, computing history is full of other kinds of command line interfaces.
- deafpolygon 2y agoThat's why I appreciate MS's efforts to improve PowerShell and Terminal.
- albertzeyer 2y agoI really would like to have: * text folding (https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/3 https://gitlab.freedesktop.org/terminal-wg/specifications/-/..., https://stackoverflow.com/questions/52812618/ansi-escape-sequence-for-collapsing-folding-text-maybe-hierarchically https://stackoverflow.com/questions/52812618/ansi-escape-seq...) * graphics (https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/12 https://gitlab.freedesktop.org/terminal-wg/specifications/-/...) I wonder a bit why all those next-gen (often HTML-based) terminal attempts have not been successful (e.g. TermKit: https://news.ycombinator.com/item?id=30517205 https://news.ycombinator.com/item?id=30517205). Probably because SSH/Mosh/Tmux concepts are difficult to take over there, and those are somewhat crucial. And text folding or graphics also would have issues w.r.t. those (see also the linked discussions). DomTerm (https://domterm.org https://domterm.org) supports both those features, but it does not work with Mosh+Tmux, which is my main use case.
- alain94040 2y agoAccept a subset of html as a tool output? So if a CLI tool wants to output a list just do: printf(“<li>item 1”); And legacy tools are obviously supported as raw text since their output doesn’t start with a magic html tag.
- morning4coffe 2y agoExciting to see the state of the terminal evolving! While there's a lot of legacy to contend with, efforts like Microsoft's new terminal are definitely steps in the right direction. It's a fascinating area to watch, and I'm curious to see how tools like the alternative shell and terminal emulator mentioned will shape the future of text interfaces
- thibran 2y agoI love the abstract idea of the command-line, but not it's textual implementation. The best currently available old school shell is Nushell IMHO. What I really want is a GUI that works like a command-line, but with rich media and mouse support. Instead of 100% key input I would sometimes like to click and add/remove/filter data. The terminal is so useful, still it's strange we tolerate up to this day all it's shortcomings.
- barfbagginus 2y agoI have transitioned to a category theoretical terminal interface (CTTUI). At this terminal, whenever I have an idea and I want to see it in practice, instead I think about some nice happy functors dancing in some nice happy 2-category of functors and natural transformations. Sometimes I will draw a string diagram proof that looks like a bowl of spaghetti, which makes me hungry. Very soon the desire to use a computer passes. And that is how 50 years of awful terminal tech debt is universally avoided, just by tapping the power of categories!
- bainganbharta 2y agoAs expected, a bunch autists arguing in here.
- DaSHacka 2y agoWhere have you seen arguing? Unless moderators purged a bunch of comments, seems like people are just discussing the history of terminals and how they could be improved going forward.
- waynesonfire 2y agoI use dvorak keyboard layout and the "." is a prime real estate location on the keyboard. Unfortunately, ctrl+. does not work in emacs over terminal.
- 1vuio0pswjnm7 2y ago"This has a multitude of problems, however. The terminfo database is part of the ncurses library, and different operating systems and distributions package different versions of ncurses. This was a problem for tmux users on macOS for many years because the version of ncurses packaged with macOS was so old that it did not even include the tmux-256color terminfo entry at all!" I build static Linux userlands from scratch using only busybox/toybox and a statically-linked GCC. When compiling programs, e.g., tmux, I have been using netbsd-curses instead of ncurses. After I compile tmux statically, the terminfo entries needed by tmux, i.e., needed by the curses libraries compiled into it, are contained by default in the directory $HOME/.terminfo. If nothing is found there, tmux then checks /usr/share/terminfo (or whatever path was use when compiling, e.g., /usr/local/share/terminfo). This directory can of course exist apart from a curses library installed in a directory. In the userlands I make, there is no curses library installed in a directory after I have finished compiling all the programs. For example, I can make a tarball of the terminfo directory from any suitable up-to-date distribution and untar it on the target computer. Or I can make a hashed database of only the entries I need. For me, the terminfo database is not "part of the curses library"; curses libraries provide an example terminfo database and a utility to compile terminfo entries. If the entries were truly part of the library, then one might argue they would be compiled into programs along with the library when compiling statically. I keep a personalised copy of a terminfo database, i.e., a tarball of a terminfo directory, separate and apart from a curses library. To be used with whatever curses library I choose. Not to suggest there is a great variety of curses libraries to choose from.
- 1vuio0pswjnm7 2y agoNetBSD curses actually does compile a few terminal descriptions into the library https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libterminfo/genterms https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/lib... ansi dumb vt100 vt220 wsvt25 xterm Unfortunately, netbsd-curses for Linux removed vt220 while almost tripling the size of the list I prefer vt220 am not interested in 256 colors https://raw.githubusercontent.com/sabotage-linux/netbsd-curses/master/libterminfo/genterms https://raw.githubusercontent.com/sabotage-linux/netbsd-curs... xterm linux xterm-256color ansi dumb vt100 screen screen-256color tmux-256color rxvt-unicode rxvt-unicode-256color st-256color dvtm dvtm-256color fbpad-256