What I would really like to see is more integration between terminal emulator and the shell (and commands you run in it). Currently in Fedora/GNOME the shell prompt is set up to make the terminal notify you (with a native GUI notification) about long running commands completing. That's cool, but we could go so much further.

For one, the shell could let the terminal know the current directory, hostname, username, git branch, current command, last command status, etc. etc.

The terminal then would display that info in its GUI, and perhaps even let you interact with it (imagine a GtkPopover for changing git branches and a Nautilus-like pathbar for the cwd!) We could then shrink back the prompt back to a simple dollar sign.

That would already be infinitely cool, but it gets better.

What if the shell could send its completions to the terminal and the terminal would display them in a native autocomplete widget (like in Builder)?

What if the terminal could track where the output of each command is and allow you to collapse/expand it with a GtkExpander? What if it could visually present each command and its output as this expandable card, along with the time it was issued and the time it took to run (like `time` outputs) and its exist code? And if it failed, paint that card red? And if it segfaulted, add a button to duck duck go the error, run ABRT or even run dnf debuginfo-install and coredumpctl gdb?

What if pagers like `less` could make use of the native scrolling instead of faking it by moving lines? What if `man` rendered the content to HTML (or GTK's native markup format) and presented it as an actual page, sort of like what you get by running `yelp man:foo` but right there in the terminal?

What if `ls` could make use of the native list/table widget and render file icons, just like Nautilus? What if you could expand the folders it outputs right there using mouse and get a tree view?

Don't tell me that fish or vim already display completions in a pop-up using some magical pseudographics. I'm not talking about abusing the old grid-of-characters model of terminals. I'm talking about making the shell and the terminal communicate better so we can use *native* (e.g. GTK+) widgets for what is traditionally done using text-based interfaces.

Mind, just like currently `ls` knows to columnize and colorize its output and `grep` knows to highlight the matches in red *when outputting to a terminal*, but fall back to plain text when piped to something, what I'm describing here would simply fall back to plain text when piped or run in a less magical terminal. So this is about enhancing the existing tools, not about breaking compatibility in any way.

And at the same time that would really get the terminal/shell experience from "emulating ancient hardware to be able to do stuff we haven't yet made a GUI for" to "a way to do advanced stuff with your computer using a command-based interface".

That would truly be a command-based interface for the 21th century. That would be something I'd be proud, not ashamed, to show off to Windows users as the advanced way to tune your system.

I've made a mock-up to illustrate my ideas about the next-gen terminal experience!

• the pathbar
• username, hostname and git branch displayed in the UI, shrinking the shell prompt back to just a $
• commands as cards
• syntax highlighting, including graying out the output a bit to differentiate it from commands themselves
• autocompletion (displayed in a native widget)
• built-in error handling options
• the time each command took (on the right)

All the widgets are interactive! You can click on the pathbar to `cd`, and the popovers on the bottom bar let you basically do `ssh`, `su` and `git checkout`; the git one additionally allows you to open the current repo in Gitg or in Builder.

Since everyone seemed to love my terminal mockups, I've made another one!

This is a further design exploration, showcasing:
• background jobs label/popover
• `ls` displaying an actual list of files! Of course, they are interactive, you can drag'n'drop them from here, click them to open, and right-click for more options.
• autosuggestions being contextual: here, they suggest you to re-run `apt` as root or read the docs
• a collapsed card
• `git` using real graphics

@bugaevc vaguely remember a project like this from a long time ago, an attempt to make the terminal show specific data more "intelligently"

oh found it: github.com/unconed/TermKit
(apparently also abandoned since 2011 !)

i guess the closest i otherwise can think of is the ipython-qt console which can show graphs &c inline

@brainblasted I wish! This is just a Glade .ui file plus a .png for the content.

Ask GNOME/Tilix devs/designers if you'd like to get a real-life version of this 😉

@bugaevc I was skeptical as you described it but I'd really like this if feasible

@bugaevc if you could have the bash-completion scripts indicate what sense each argument has (flag, file path, bare words), then the display could color / frame them, as well

@riking and not just that, the autocompletion window could display man snippets for options, like in these screenshots: github.com/railsware/upterm

@mbirth it sends commands to the shell (I imagine some escape sequence-based protocol, but I haven't thought about the specifics too much). See my other replies in this thread where I went into some more details about how this protocol should be shell- and toolkit-independent and how it somewhat resembles DWDs.

@bugaevc Ahh, so it's not a new shell, but some overlay which only works in a GUI? From the screenshots it looked like most features could be woven into a shell and thus be available on many systems without the need for a special terminal software.

@bugaevc have you tired any of the electron terminal applications that offer some of this functionality? If so, did you end up sticking with one?

@david uh, no. Have you? As far as I've seen, they're all in a prototype stage *and* abandoned.

@david Upterm (née Black Screen) and TermKit (technically web-based but not Electron-based) are the ones I'm talking about, they do offer some of these advanced features.

Hyper & Terminus don't seem to, and I don't see any reason to use them over a native terminal emulator app.

@bugaevc Fish actually can do a bunch of these things! It also has fancy things like commandline parameter auto-completion and inline auto-suggestions


@bugaevc and there are themes for it to do things like displaying the current git branch (and status via colour)

@theoutrider read the "don't tell me..." toot above :D

I do use Powerline! In fact, this thread started out as me talking to @federicomena about how I would like to see things Powerline does integrated into the native UI.

I love Fish. It's not POSIX, but you can always type "bash". I'm starting to like fancy emulators like Hyper.js a bit more too.

@bugaevc Idle thought: why not make the command grey, leaving white for output? The user knows what they've typed, but doesn't know what the output will be.

@wilfredh I've thought about that too! On the other hand, like half of the commands you type are more important that what they output (if anything), and it wouldn't look as pretty.

But this is just a mockup and I'm just a dev wishing for a better terminal experience, I'd rather let actual designers figure out what looks/works best.

@bugaevc This is great ! Even just being able to have something similar to [devicons](https://github.com/vorillaz/devicons) in `ls` results would be killer.
But I don't think it's the terminal's work to implement any of this.

@bugaevc this seems overcomplicated, I'd much rather have something like Acme or Plan 9's rio shells and build these things on top of that

@bugaevc it has a coolness factor to it but I would sleep better if I knew that whoever implemented this took a look at acme and rio first

@grainloom @bugaevc And, going back even further, Symbolics Genera and other Lisp Machine implementations.

@grainloom @bugaevc Both of you are not contradicting each other there :)

@ckeen @bugaevc I mean, it looks cool but uuugh, I hope it doesn't end up as its own OS and will integrate with the rest of the system

otherwise this just looks like ZSH with some GTK/Qt added

@grainloom @bugaevc

TBH all these fancy shell prompts and such are getting pretty ridiculous. If you are using a graphical UI it should take advantage of that. So far all we have are some weird terminal emulators with a baud rate setting.

That has to change

@ckeen @bugaevc @grainloom

I think you are undervaluing the efficiency of text.

Compare the logographic below to its (possible) translation:

"If a man utters this spell while pure, it assures going forth by day after his death" (see quora.com/How-does-Egyptian-hi for further info and translations).

We have a spacial problem (pixel to meaning ratio), a problem of composability and a problem of interpretation.

IMHO, text centric UI (like #Plan9's one) are simply too ahead of times.

@ckeen @bugaevc idk, I like a lot of the ideas in theory but if it's not as portable and modular as what we currently have, I don't see myself using it anytime soon
i'm not against making UIs better but I'm not sure how I feel about these ideas

how does it compare to what came before? how does it compare to Emacs?

@grainloom @bugaevc

None of this is portable in any way. That's why we are still stuck with what we have. Every wanted to know how the graphical shells change their title? There are some escape sequences for that. Icky stuff...

@ckeen @grainloom well, the idea *is* to make it portable. The shell and the terminal emulator would negotiate over some standard escape sequence-based protocol, and that protocol would not be bash- or GTK- specific, it'd work for any toolkit and shell combination. A bit like DWDs if you remember those.


I boosted because I had the exact same reaction of @grainloom : this interface is cool but cannot be done with a shell.

Some aspects of what @bugaevc propose are part of what I'd like to try in the #Jehanne UI (admitely a low priority task), but in a way that do not increase the complexity of the shell too much:

- the pathbar
- username
- folder specific tools (eg git/hg branch displayed in the UI)
- autocompletion

but I'd like to retain:
- editable output
- plumber integration

@ckeen @grainloom @bugaevc

Note that all of this could be built in Jehanne without modifying the shell, but we need a new screen multiplexer (aka rio) that somewhat integrate a text editor (eg sam) and a modified graphical terminal (aka win) to do the integration/framing.

This could hurt network transparency over 9P, though (I'm trying to design my file protocol so that it can preserve such transparency, but it's a loooong process, don't hold your breath).

@grainloom @ckeen I am, in fact, a fan of Plan 9 and have used acme as my editor in the past! (On freaking :windows: 10 vk.com/wall268678817_641)

And this ideas are partly inspired by how Plan 9/acme/rio are all integrated, whereas in today's systems we have a sleek GUI and a powerful CLI that live in very different, disconnected worlds.

It would not be feasible to adopt acme's model directly, because modern interfaces are not all text, so instead, I opted to enhance the CLI UX with modern GUI advancements

@bugaevc @ckeen how about Emacs? they combine text with images pretty well AFAIK, although that IS its own OS

@grainloom @ckeen I don't know much about Emacs — are you talking about displaying images inline (with X11-specific hacks?..) or integrating actual GUI widgets into the CLI experience?

@grainloom @ckeen perhaps you can point me at a demo of how it works in Emacs then? I thought it was TUI-only, possibly in a basic GUI frame.

@bugaevc @ckeen I'm not a huge emacs user either, I sometimes use it with Idris and the Idris shell displays an image on startup

but maybe things like Jupyter are more relevant to the "what if we could render HTML in the terminal" question

@bugaevc @ckeen and these all use their own languages (well, jupyter has multiple kernels but whatever) so I'm curious how these would fit in with the shell

do they need a new shell language? or just new escape codes?

if this was Plan 9 these could be handled by things like /dev/draw but it's not

@grainloom @ckeen yes! Jupyter is *amazing*, even though it's web-based.

OTOH, I'm focusing on the Unix shell and native widgets here. Python/Jupyter is mostly about visualizing data — it does nothing to display or let you control the state of your Python session in its GUI.

@Shamar @ckeen @bugaevc @grainloom
$www-browser --dump $file

where www-browser is something like lynx or w3m.
Sign in to participate in the conversation
Mastodon for Tech Folks

mastodon.technology is shutting down by the end of 2022. Please migrate your data immediately. This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!