Live data from Hacker News

Ask HN: What do you love/hate about terminals? Would you change them?

news.ycombinator.com

111–120 of 204 posts

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#111
I'm excited about notty [1], but I'm bummed the repo hasn't seen much action in awhile. I think the maintainer is on the Rust core team now. Some of its goals from the readme:

- Full support for rich text formatting, including 24-bits of color.

- Full and correct support for all of Unicode.

- Lossless keyboard input.

- Inline media content, including raster graphics and structured data.

- Dropdown menus, tooltips, and other features which do not strictly reside in the character grid.

- Local echo and retained off-screen character grid state to reduce the need for the tty to transmit data back to the terminal.

- Subdividing the character grid to enable more complex interface layouts without repeatedly reimplementing that logic in the controlling process.

It cites Gary Bernhardt's talk A Whole New World [2] as a major influence. There's an open issue in the tracker for the Alacritty terminal emulator to implement notty [3].

[1] https://github.com/withoutboats/notty

[2] https://www.destroyallsoftware.com/talks/a-whole-new-world

[3] https://github.com/jwilm/alacritty/issues/51

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#112

First, if I want to come up with a setup that includes a modern terminal emulator with lots of features, a decent number of extensions and plugins for things like zsh, etc..., I will INEVITABLY end up with a something that: 1) has way more input latency that it should have (iterm2, Ive had to just fall back to Terminal.app) 2) takes WAY too long to launch a new bash/zsh/whatever session if I split a window (cause par…

At the risk of starting a quasi-religious argument, the object-orientation of Powershell is one of the things I really like about it.

I don't really care about how they tried to solve it, I'm just glad they addressed it.

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#113

> - What do you love about terminals? The cursor is (generally) an absolute source of truth: Terminals usually behave very predictably. A good terminal does not get in my way or have any bells and whistles. Text goes in, output goes out, there's support for whatever the application needs wrt graphical capabilities and cursor manipulation. That's it. I don't want to have to deal with "oh god I accidentally clicked on…

Couldn't agree more with you. Simplicity is the key to a sane world. I haven't had any problems with colors or fonts with st since I dropped urxvt in favor of the former. It is also harmful to assume that bash is always present, or worst, that it is the default shell; I've spent a reasonable amount of time learning how to effectively write portable shell scripts that can run in any Unix-like system, because portability is important. Bash is huge, and that makes it more prone to error and bugs, not to mention slower, the perfect balance I've found between speed and interactivity is mksh, I know dash can be faster, but it only works for scripting, as an interactive shell it sucks, and that's ok.

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#114

I'm a Mac User, and honestly I think the Mac terminal is fine and there's very little room for improvement. But if I were to improve here's a few of the things that I would do: - Make it easier to know what the current process is and kill it if it goes haywire. An out-of-control process can trap control C and ignore it. I really hate digging into activity monitor to kill a process when I just want to keep the same te…

> An out-of-control process can trap control C and ignore it.

Many programs that trap SIGINT won't trap SIGQUIT so ^\ will still kill the process. Even if they do, if ^Z works then kill -9 %1 will be good.

> A better display of my current working directory, and my current git branch. These items should be displayed at the edge of the window, not inside the terminal itself.

MY prompt has been \$ for ages, and I've many names complained about my failing memory, but since I don't change directories often this causes me little grief (and being in one directory means my ^R search is very useful). Have you considered just storing this information in the title? Many virtual terminals have an escape sequence that sets the title.

> Allow me to collapse the output of programs, just like we can collapse comments in hacker news.

This sounds very useful. Perhaps it would be implemented as an escape sequence that would be marked in the prompt.

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#115

What do you hate about terminals? Escape sequences. The current system is basically a giant bag of baggage we inherited from ye olden days. If implemented today I'd guess it would make much more sense to let a terminal application determine the actual key combination pressed (such as C-Tab, for example). I'm pretty sure that wouldn't be very easy to change, though (at least while keeping compatibility). Edit: To clar…

So basically, you hate ASCII and Unicode.

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#116
post #8

Well it is obvious to me that terminal handling and indeed the shell itself should be absorbed into systemd.... On a more serious note, the terminal has to "just work", its role is to host shells, ncurses apps, and so on. It doesn't need to have any clever features, it just needs to be a blank canvas, one that is tolerant of its guests doing weird stuff and able to recover gracefully. All the "cleverness" should be i…

> Well it is obvious to me that terminal handling and indeed the shell itself should be absorbed into systemd.... systemd is like that emacs of process supervisors.

Except that emacs is less bloated and doesn't crash as often, and not being and important program for the system, one can easily replace it with more simple software.

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#117
post #45

Earlier quoted context omitted.

Have you checked out ZSH? It can do this nicely.

zsh via its ultra-tunable completions can do only 1st part of op's request i.e command option completion, but not the second part i think... for example, i do the following: anupam@virat ~ % autoload -Uz compinit anupam@virat ~ % compinit anupam@virat ~ % git a add -- add file contents to index am -- apply patches from a mailbox apply -- apply patch to files and/or to index archimport -- import an Arch repository int…

Weird. I'm using Zsh and I swear I've tried that before with nothing happening, but it does actually work. Thanks!

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#119
If I were building a terminal from scratch... Hm.

Attempts to improve the terminal are not backwards-compatible or do not otherwise provide a clean upgrade path. I would love to use one of those fancy graphical terms that comes up on HN every now and then, but because they only work with a special toolchain that speaks its language and its language only there's no way they'll ever gain critical mass and take off. Any attempt to improve the terminal has to be something that I could switch to on a whim and then gradually grow into.

I really like the "curious fact" from higher in this thread and I think that it's important. Whatever the solution is, I think that it'll necessarily involve separating "business" logic from presentation logic, and giving presentation logic to the terminal while things under the shell handle the actual work. Right now, one of the biggest problems with writing a CLI tool is that TUI work is a huge pain in the ass. It's harder to make a table in the terminal than it is to make a table on the web! That's insane! And that suggests a straightforward solution: Move display logic into the terminal so that it can handle layout and rendering. And you do that the same way that that's been done in literally every situation that's ever been done: You ship a small program that constructs a view that can take advantage of a more favorable execution environment.

So what does it mean to "ship a program that constructs a view"? Well, even if your program is written in a deeply standardized, weak language (e.g. ANSI escape codes) it's still a program. Formal languages theory, hooray. So we're already operating in this formalism, which makes our job much easier and the solution relatively obvious - Instead of inventing an entirely new paradigm from the ground up we just need to jam a more powerful language into an unused corner of the existing one.

This is where I go down the rabbit hole, because I don't know enough about the specifics of ANSI escape sequences. My goal, essentially speaking, is to find a set of sequences of control characters (a language) that will be ignored by everything except my New Terminal, map that set to some convenient programming language (ideally by a trivial "prefix-identity-suffix" construction), build a platform for building user interfaces that uses that programming language, and then build... something that augments existing programs with New Terminal front-ends? A lump of stuff into my shell RCs that detects New Terminal and augments the prompt strings with New Terminal apps that wrap the outputs of commands that look right?

Then the question is, what does my platform look like, and what convenient programming language am I using? I'd probably go with something like js or guile. Maybe just js so I can take advantage of extensive existing UI tooling. I mean, if you look at this sufficiently sideways, I've essentially duplicated the evolution of HTML+JS webapps - jam a new language (js script tags) into a corner of the existing language (html) that will be ignored by systems that don't understand the new thing and then implement a platform (DOM manipulation and such) that allows the creation of fancy user interfaces (webapps) using those tools. And really, I think that that's the clincher - that evolution happened when client machines became powerful enough that it was useful to move presentation logic out of the server and into the client, and that's exactly what we need to do with terminals.

(thought: interaction. callbacks return a sequence of characters that're typed into the terminal? so you can click on a table header and the client sorts and re-renders the table, or you can click on a button and to run a convenient follow-up invocation? ahhh, yeah - if the backend program (ls et al) is transient its interactions will render commands for follow-up operations, if it's persistent its interactions will render keystrokes for interacting with it - you'd click on the headers in top and it'd send `p`, `t`, etc. that's really clean.)

Re: Ask HN: What do you love/hate about terminals? Would you change them?

#120

I often lose my place in a sea of similar outputs. It's infuriating that distinguishing which command belongs to which output at which time requires me to rely on my eyeballs. So for example it'd be nice if my output folded up after the following command is run. If `time` was run automatically. If I could switch on autodiffing between runs of the same command. There are probably other such ideas.

We already have a solution for this sketched out on paper (not in writing or code yet, though). The idea is that the shell can split the terminal into "frames", where each frame acts as its own terminal. The shell would then use one frame per command prompt, and one frame per command (for its input and output). The stdin/stdout that is given to the command is restricted to that particular frame. It can then write tex…

I think this would be pretty easy to do in eshell. Emacs gives you frames already and supports interacting with output buffers (like compilations errors)

Its been on my to-do list for a while. I wrote a rough outline and its similar to what you've said as well: https://reddit.com/comments/6y3q4k/comment/dml16vq

Post reply on HN