7 ms·
I'd love to find a shell + terminal that's aware of the semantics of shell output. One nice thing about (good) GUI programs and websites is that 'results' are
by WalterGR 10y ago
I'd love to find a shell + terminal that's aware of the semantics of shell output.
One nice thing about (good) GUI programs and websites is that 'results' are quickly navigable. In a terminal, I'd love to be able to drill down into results of ls; from grep output quickly open a file and jump to that match; etc.
(Shell output can be in any format, but even if it could grok the output of only specific programs/commands (and also their switches) that would be a starting point.)
Does anything like this exist, for any platform? It seems like PowerShell could be a good match, but I don't know anything about its ecosystem.
- jevinskie 10y agoiTerm hyperlinks strings that are valid paths. Cmd+click to open. It is immensely useful!!
- chipotle_coyote 10y agoThis is something standard OS X Terminal does, too, although it's either a right-click or command-doubleclick. Terminal actually does a lot now that it didn't a few years ago.
- deleted 10y ago[deleted]
- jasonm23 10y agoReally? I can't check for a few hours. If you did... ls cd .. Would all the listed files be clickable in the ls output? This is what the parent comment is referring to in iTerm.
- jstimpfle 10y agoThat exists, it's called GUI... Improving on the text model is almost always premature optimization, though. Consider the incredible cost for an observer to "understand" what you are doing. Insane amounts of work (resulting in lock-in or a product never shipped) is not how the text model could become so successful. Why can tools like grep or sed be so immensely useful? Precisely because they don't need to understand what goes in (other than a stream of lines), what does the pattern mean (other than being a regular expression), and what goes out (other than a stream of lines). And what's the benefit of programs understanding "semantics of output" really? Everything is text. When a file is printed on the terminal, select it (e.g. double-click), type "vim " (or whatever), and middle-click. It's good enough most of the time. When there is some really dry repetitive work, bang out a command-line to automate that for you (along the lines of "while read filename; do vim filename; done"). A GUI can only help for the most common cases. If these are only a minority of cases, GUIs are only crippled tools preventing you from doing real work. (Personal anecdote: I use nothing but a browser and xterms on most days or even weeks).
- WalterGR 10y agoEverything is text. No. In PowerShell, console output is 'typically'[1] of a well-known type. It is therefore entirely possible for a shell + terminal to be aware of the operations available on its output. [1] For some definition of "typically"... PowerShell permits arbitrary manipulations of output, so obviously there are circumstances where this is impossible.
- jstimpfle 10y agoYep, my post was unclear. "Everything is text" is the Unix idea. I know that PowerShell pipes objects and that's exactly the problem from an architectural standpoint. It's what makes it expensive to create and integrate components.
- electricEmu 10y agoYou're pretty much asking for PowerShell. I've been using it for a while, which might jade my answer. That said, I've got it being installed on my Unix systems as my one-true-shell. You stream objects instead of text. The objects can be rich. It's a huge step forward in semantics and consistency.
- WalterGR 10y agoIs there terminal support though for navigating the resulting objects?
- jstimpfle 10y agoThink what "navigating" should mean. If it's a vague, abstract thing which could mean a million different things in practice, the answer is likely "no".
- WalterGR 10y agoWell, I've given examples above of what I mean, so I think that one could extrapolate that to other examples... But to put it in more concrete terms: Is there a shell + terminal that permits the user to interact with shell output - in specific circumstances - whereby "interact" I mean: * the ability to view additional properties (which are hidden by default) of objects represented in the output * the ability to make a user-selected object the primary focus of investigation * the ability to easily (think - right click, or keyboard commands to accomplish the same) expose verbs that can be activated on those objects, and additionally to choose one?
- jstimpfle 10y agoThere are many people around the internet hating it with a passion. I believe them. There can't be a tool that magically reads all of your wishes. Serious question, have you ever known a technical Windows sysadmin? I tried to backup a directory tree today as a domain administrator using robocopy, and could not do it without messing with file permissions. Not that today's Unix is that simple anymore...
- tadfisher 10y agoYou've described Emacs, which is a huge library of frontends to common Unix utilities. Dired, for example, just parses `ls` output.
- WalterGR 10y agoIt's no surprise to me that Emacs has already solved this problem... Are there examples beyond dired?
- andreareina 10y agogrep output, compile errors link to the relevant file, and location within said file.
- SomeHacker44 10y agoYou really want Genera. Just about every depiction of something beyond mere verbiage was interactable in its shell.
- steinuil 10y agoI'm writing a shell that does this; right now I'm working on the language itself (a somewhat functional language with basic types and records) and its parser (the syntax is like a terser OCaml mixed with Ruby, designed to be quick to write), but eventually it'll reimplement most unix programs so that their output is actually a type it recognizes, and it'll have something like a FCI (Foreign Command Interface) that would let you easily parse the ouput of commands it doesn't implement. It's not uploaded anywhere yet (and there's not much to look at right now, just an unfinished parser and the beginning of an interpreter), but when I have time to work on it and put it in a somewhat functional state I'll post it on here too.
- hawski 10y agoPretty close to what you describe is Acme [0] the text editor/shell from Plan 9. It is mouse oriented edit. You can right click on words to search them in file or open text files, directories or compiler errors. I recommend viewing this [1] introduction video. I miss few things in Acme. A bit more WIMP-y familiarity and a 3 button mouse. That's why I'm working on experimental text editor inspired by Acme [2]. [0] https://en.m.wikipedia.org/wiki/Acme_(text_editor) https://en.m.wikipedia.org/wiki/Acme_(text_editor) [1] https://youtu.be/dP1xVpMPn8M https://youtu.be/dP1xVpMPn8M [2] https://github.com/hadrianw/werf https://github.com/hadrianw/werf
- kps 10y agoI really like Rob Pike's minimalist principles but somehow dislike most of his implementation choices. I can't be productive in acme due to missing my #3 arm, but I'd kill for structured regular expressions in vim.
- Chris2048 10y agoThat would surely require rewriting all terminal programs, to get their output structure?