[Konsole-devel] [konsole] [Bug 354853] this is a wish. second window which helps terminal window user with fields of terminal window tool output

Micah Cowan via KDE Bugzilla bugzilla_noreply at kde.org
Thu Nov 5 19:51:35 UTC 2015


Micah Cowan <micah at addictivecode.org> changed:

           What    |Removed                     |Added
                 CC|                            |micah at addictivecode.org

--- Comment #3 from Micah Cowan <micah at addictivecode.org> ---
mika, an environment variable which stores the last given command tells quite a
bit less than you think.

First of all, it's _not_ an environment variable, but a shell variable. It's an
internal data stored only in bash, other programs can't get to it.

Even if bash exported it as an environment variable, it doesn't actually set
its own environment, only in its children. And even if it did set it in its own
environment, it wouldn't be reliably readable by Konsole. Reading other
processes' environments than your own is not a portable or reliable activity.
What if the running program is as root (e.g. via sudo), but konsole is running
as a normal user?

Finally, even if Konsole could reliably get access to "the last command bash
ran", how would that help it to do what you asked? Your feature request not
only requires that Konsole know the command currently running right now (that
is, "the last command" is way too late), but how it operates, and what the
semantics are of everything it draws to the screen. Even if Konsole had a
database of all the possible editors you could use (which would be huge) and
how they work, it'd still be difficult for Konsole to do that - the only real,
working way, is if the running application had a means to _tell_ Konsole what
it's doing and where.

In other words, it would be a huge and fragile project that's far outside
actual scope as a terminal emulator.

HOWEVER: there is at least one project that does things similar to what you're
asking for (not the editor stuff, though - that's just really too hard). Like,
allowing you to click on a file listed from "ls" in order to perform some
action on it. As far as I know, it doesn't give a lot of contextual information
by hovering over filenames, but they probably have the capability to do so, and
might be open to a feature request like that. It is experimental and
incomplete, and can't do it for everything. It mostly works through a
combination of tools that talk to it explicitly about what they're doing, and
some programs (like ls?) whose output format is unambiguous enough that it can
be parsed for information. Unfortunately, I've forgotten the name of this
project, and don't know if it's even still maintained (a project like that
would be quite daunting, and require rewrites of most standard Unix tools to
make their own versions that can work with it). Maybe you'll have better luck
than I at finding it again... but it's not something that really falls within
the range of things KDE could realistically do.

I did find this, which _might_ be what I was thinking of:

As I say, it's far from complete, and I don't even know if it actually had the
features I was thinking of (clickable ls listings, etc). But basically anything
that does what you say would probably have to be a combination
terminal+shell+utils, not just a terminal.

Good luck.

You are receiving this mail because:
You are the assignee for the bug.

More information about the konsole-devel mailing list