Live data from Hacker News

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

news.ycombinator.com

171–180 of 204 posts

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

#171

Earlier quoted context omitted.

Pretty much any modern shell (bash, zsh, fish, etc) provides command line completion.

If you really think the completion in current shells is the best there can be then I think you lack imagination. I don't want remembered commands, I want the terminal to tell me what stuff means. I want it to tell me what makes sense in which context. Like the IntelliSense when coding Java or C#. Docs at your fingertips, all relevant options (and none else) available, etc. This is incomparable to the kind of autocomp…

Of course you could always do better, but the specific feature mentioned in the parent comment (completing flags for "tar" instead of checking the man page) has been around for ages.

Regarding contextual analysis, the fundamental problem is that command execution relies on a list of strings (argv) with no types or meaning. Each command is responsible for parsing its own arguments, either manually or using a shared library (e.g. getopt). This provides loose coupling and flexibility, but makes introspection really difficult, and features like completions become an afterthought reimplemented in every shell either by special cases for each command or hacks like parsing help messages.

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

#172
Love: That any terminal anywhere that speaks VT100 -- including real DEC hardware from the 70s and 80s, "communications programs" for DOS or Windows, and modern ssh clients -- can interact with a program that also speaks VT100, and that program thereby can produce a clean, usable, if not elaborate UI on 8-bit hardware with KiB of RAM through to 64-bit hardware with GiB of RAM and beyond.

Hate: Mainly kids who've never seen or interacted with a dialup or other serial connection, let alone a real hardware terminal, who think that "the terminal" is some software construct which can (and therefore should) be thrown out and replaced with something based on the ergonomics of a 2017 Macintosh.

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

#173

Probably the most frustrating thing for me is when I’m connected to another terminal via ssh and am typing in a command (without using autocomplete). When I am on a poor internet connection the latency between rendering each keystroke makes me want to throw my computer out the window. It would be cool if the local terminal could render text at the speed of typing and while lazily sending that back to the other machin…

mosh[1] provides the buffering you're looking for and some other useful features, at the cost of extra complexity that could lead to other issues (e.g. no scrollback unless you use tmux as well).

[1] https://mosh.org/

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

#174
post #23

Earlier quoted context omitted.

>Modern IDEs can tell me exactly what can follow after a certain piece of text I don't think that's computable in a terminal.

It could be, if there was a standard format or protocol by which a shell can ask a command what flags/options make sense in what context. A bit like how man pages are a standard format for static docs, every tool could ship "autocomplete files" which tell a shell how to build the autocomplete. These files could even contain runnable code (in sh or something) without an additional security risk - after all, they came…

This is pretty much how bash completion works...

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

#175
post #163
post #48

Earlier quoted context omitted.

iirc, there is a program called 'nl' that should do the trick

I find "nl" pretty useless, because it only numbers non-empty lines, which is never what I want. There's "cat -n" which numbers all lines. (-n is not POSIX, but it's available on at least on BSDs and Linux.)

> ... because it only numbers non-empty lines...

oh, that's just a man page lookup away. use 'nl -ba' which numbers all the lines. default style is '-bt' which numbers only non-empty ones, as you have experienced...

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

#176
post #86

Earlier quoted context omitted.

> 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…

Presumably it would be in the same fashion that file dialogs are generated; you defer the actual selection to some OS-provided library function, and just accept a standardized output (some FileObject construct). So the terminal would provide this file selector, based on context: a script would take it as the filename itself, the interactive shell would provide the file dialog, etc.

Terminal Programs are already outputting differently based on context (ie ls to a pipe vs screen), so supporting interactive and scripting is hardly a novel idea in the space; its just that the interactive support hasn't fundamentally improved in decades

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

#177
post #159
post #125

Earlier quoted context omitted.

You mix up the := operator with the = operator? (-: There's no chance of mixing them up with the "test" command, note, which is what ajkjk was talking about (even though xe erroneously attributed this to the Bourne Again shell language), because the test command has no assignment operator. Whereas what it does have is a whole bunch of syntactic gotchas that bite people with depressing regularity. * Miss quoting varia…

"Real" languages use "=" and "==" ;) Was unfamiliar with the minefield of bash issues, still, I do like the -eq operator, even if bash implements it poorly.

On the contrary, a real language uses .EQ. . == is for the chattering classes who use the # sign when posting to social media. You appear to be eating quiche. (-:

* http://gordonbell.azurewebsites.net/ibm-026/ibm-026-ref-27.j...

Rex Conn knows how a real language does relational operators.

* https://jpsoft.com/help/conditionalexpressions.htm#r

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

#178
post #23

Earlier quoted context omitted.

>Modern IDEs can tell me exactly what can follow after a certain piece of text I don't think that's computable in a terminal.

It could be, if there was a standard format or protocol by which a shell can ask a command what flags/options make sense in what context. A bit like how man pages are a standard format for static docs, every tool could ship "autocomplete files" which tell a shell how to build the autocomplete. These files could even contain runnable code (in sh or something) without an additional security risk - after all, they came…

That's not exact, it only works when certain conventions are followed, which is the situation we have now and will always have because unlike IDEs which typically autocomplete context free (or nearly so) languages your asking for auto completion to be done on what is essentially a very complex recursive language.

Also zip sucks, use tar or cpio.

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

#179
post #116

Earlier quoted context omitted.

> 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.

This is simply not true about Emacs. I have to restart my Emacs every couple of months because it gets too slow. I am not quite sure how to debug this.

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

#180
Better integration with multiplexers like tmux and screen. Thus I get native window boundaries for easy copy&paste with a mouse. I think iTerm2 can do this on macOS but no Linux/BSD-one. There is terminator which has this functionality but it does its own thing and doesn’t use a multiplexer in the background. Essentially terminator but with tmux and Screen (both for choice of the user…even though I think tmux is superior) in the background, so that I can let sessions run in the background and have them available when I connect via ssh or have them survive when the WM should crash. In addition I am a sucker for theming. Thus easy themability and an easy way to import and export themes. With 256 colors of course and not only 16. Otherwise I am pretty uninagimative because most of the stuff is handled by the shell anyways and I need to ssh into servers all the time, so for stuff like auto-completion the terminal would need to have knowledge about the remote server as well which would be problematic probably. Easy ways to resize - not only drag and drop but give me a way to enter dimensions when I am on a legacy machine which has only screen and I have to share a session with someone. And it would be neat to save session layouts. So that the terminal opens up my last session with 10 terminals placed on the right positions on my screen (but tmux-integration might solve that already) and maybe even remembers which servers I connected to last in which terminal. So when I restarted my computer I open the terminal and it starts to connect already my ssh-sessions. It is really annoying when I restart my machine and have to reconnect to a dozen servers and arrange all the terminals.
Post reply on HN