Live data from Hacker News

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

news.ycombinator.com

81–90 of 204 posts

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

#81
post #34

Here are my comments and concerns. 1. Minimal latency from keyboard to screen. 2. As others have mentioned here, awareness of line wrap, so that cut and paste work correctly at all times. Not just for raw output from a command. Editors too should communicate with the terminal to indicate that it is wrapping lines. 3. 24-bit color. 4. Apps (shells, editors) can query and set the window icon as well as the window title…

"cat" could never work of course, or the general idea of a terminal that has only a pair of input/output streams must be given up. I don't think people are willing to do that. A sensible protocol to draw raster graphics would be nice, though. (And it might exist, I don't even know). I don't care whether I need to type "cat" or the name of a terminal-based image viewer.

> "cat" could never work of course

We have an idea in that direction, where each program in a pipeline can optionally specify a file type, and the last file type hint in the pipeline determines how the stdout is rendered. So if you have "cat image.jpg", then "cat" can indicate a file type of image/jpg, causing stdout to be interpreted as an image. But if you have "cat image.jpg | grep foo" (just making something up here), then grep can indicate a file type of application/octet-stream because it cannot guarantee what the file type is.

The tricky part, from what I can see, is explaining the pipeline topology to the terminal, so that it knows that "grep" comes after "cat", even though command parsing happens in the shell only. That's still a big unknown. A previous project in this area (TermKit) mandated that applications specify a "Content-Type" header (like in HTTP) in their stdout, but that would break most existing programs, so it's not an option for us.

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

#82
post #79

I love terminals because they have a perfect memory of all the things I've typed. Many IDEs lack this feature. They don't keep a history of every menu command that I've used. Shortcut keys works for simple queries, but you can compare that to the power of repeating complex Vim commands. I also like terminals because it feels like I'm talking to the computer more directly, we're not going through a 3rd party. What I d…

If you have never encountered an Orthodox File Manager, you should try one. One can have a hierarchical display of the file system without necessarily using a GUI.

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

#83
post #72

I love terminal because it is universal tool. I use urxvt in X-session, or emacs-shell sometimes. I can use it over ssh. I have kernel console for times when Xorg is broken. It is great. Great for user and for programmer too. As programmer I need not to fo any special tricks for my program was able to work with any terminal. It just works. All I need is printf, or something like. It is much simplier than any GUI tool…

> At first I would state one curious fact: [...]

That part is so nicely said I might just steal it for our manifesto. :)

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

#84

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 text into that frame and move the cursor around inside it, but cannot break out of the frame, so e.g. it cannot overwrite the output of the previous command.

And once you have these frames, you can give them some useful properties: For example, the shell can fold them, or apply styling hints to them (e.g. so that a command with non-zero exit code can be highlighted with a red border or similar).

With frames, you can also have multiple commands running in parallel. For example, wget could signal to the shell that it will run for a while longer, but does not require user interaction, so the shell can allocate the next frame below the frame where wget is still running, and offer the next command prompt.

It also means that fullscreen programs do not need to block everything: vim may be running inside a frame that is set to the full window size, but you can just move the keyboard focus out of this frame and scroll upwards to review the output of a previous command while vim continues to run down below.

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

#85

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…

Oh yes. We want to have an API where clients (i.e. programs running in the terminal) can receive actual key/pointer/touch events if they choose to. The terminal may retain control over a few crucial keysequences (similar to how Ctrl-Alt-Del is always handled by the OS on Windows), but it has to inform the client about that.

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

#86

I think that the autocomplete story is abysmal. Modern IDEs can tell me exactly what can follow after a certain piece of text, and even the best tab completion in terminals is limited, ugly, and text-mode for no good reason. Some protocol for a real dropdown rendered in the style of the OS, plus a standard data format that allows tool builders to specify options, their meanings and the kinds of allowed parameters in…

> If I type "git " I want to see "add" as an option, with docs in a tooltip as I navigate the options. When I "git add " I want to see a list of files that make sense to add, eg only files that can be staged right now With fish you can customize auto completion for individual commands with full color and tooltip support. As a long time emacs user I want to believe that much of the required functionality for menus can…

>There should be drop-down menus for all applications, whether text based or GUI based. And these menus should be able to incorporate system-native dialogs e.g choose a file, choose a font etc.

I see how that would easily break scripts. Not in theory no, but in practice. The instant developers gets a choice on this they will develop for their needs and break others.

It breaks what I as a user expects from a terminal and if such a terminal was launched today I don't believe anyone would use it. Not because the idea is bad but because the users of a terminal have a very confined idea of how the communication is supposed to work.

It absolutely must work the same over ssh on my phone or my fridge as on my workstation (regardless of OS). KISS.

Now that doesn't mean we can innovate or improve things, but it must be done without breaking expectations and it must be compatible with the mindset of today or I don't believe anyone will pick it up.

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

#87
Hi everyone, thanks a lot for the responses. Keep them coming!

As mentioned in some of my replies, we have already considered some of the things that you mentioned (and incorporated them in our design), but your responses show that there is still a lot more to consider.

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

#88

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…

Oh yes. We want to have an API where clients (i.e. programs running in the terminal) can receive actual key/pointer/touch events if they choose to. The terminal may retain control over a few crucial keysequences (similar to how Ctrl-Alt-Del is always handled by the OS on Windows), but it has to inform the client about that.

Very good to hear! That alone makes me root for you guys.

Edit: BTW: If you really get a project going, make sure to inform us how to chip in (at least in monetary way, if nothing else. I'd like to be able to pay anyone who tackles this a beverage of their choice ;-) ).

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

#89
> What do you love about terminals?

The lack of distraction, the information density, the ability to integrate command line tools into my workflow (yes, I have "selected text is copied to the clipboard" enabled).

> What do you hate about terminals?

How slow the modern terminal is to transfer inputs and paint responses. I like a lot about how iTerm2 works (its integration with tmux and sensible keybinds), but dislike the latency even after all the recent improvements to latency.

A much more minor gripe, but I spend a lot of time working on laptops; acknowledging the lack of a middle mouse button (yes, I hate it too) as a reality for most people's interactions with the terminal would be nice.

> If you had to build one from scratch, how would you do it?

First, I would "borrow" heavily from iTerm2 - its customizability and easy defaults.

Second, I would "borrow" from the web browser rendering engines out there. Make it simple for programs to either not care about their output at all and let it look and and act sensibly (paragraph breaks, reflowing around spaces, easy tables, etc), or to define a minimum amount of "styling" to create reasonable outputs (right justifying text, centering, maximum/minimum width, etc), or have absolute control over the positioning of every item with low level feedback about the terminal.

This would have to be done in addition to a backwards-compatible escape-sequence method of placing characters, of course, and couldn't be the default, but simply making it available for new programs would be a great start. Creating libraries for such interactions would be even better.

There is a lot of history in the terminal; it's time to learn from it and plan for a future beyond ASCII.

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

#90
The simplicity is great.

All the dark art and knowledge spread around is a pain, tty controls, escape codes, etc.. I’ve used terminals for decades but where the lines are draw between terminal, shell, tty and terminal emulator might be worth readdressing; it’s 2017 and I will semi regularly see broken escape codes, Eshell in Emacs doesn’t deal with the color prompt correctly as an example.

This isn’t a terminal thing exactly but I’ve got 4K displays and greater then 1080p on laptops and there is still a strong 80 column legacy. Ideally terminal-ng would not ntroduce some future version of 80columns, I can’t think what that would be. Perhaps somehow bridging between fixed width and non fixed width fonts or something like that, somehow.

Post reply on HN