Konsole feature question (would it be feasible for me to do?) + bug report (is it a trivial fix?)

Raphael Rosch kde-dev at insaner.com
Fri Oct 25 09:20:49 BST 2019


Hi all,

I'm not sure if this is the right place to ask, please let me know if it 
isn't.

I have an idea for a feature that would greatly help my workflow, but as 
I started working on it, I quickly realized it is not trivial, and would 
like to know if it is at all feasible before I commit any further effort 
to it.

Basically, I want to add another "tab title" variable (like the "Bourne 
shell prompt" variable I implemented which I am really excited to see 
was accepted into the konsole codebase!) where you can set an 
environment variable in the shell and konsole picks it up.

I was doing something like this:

     { QStringLiteral("%v"), I18N_NOOP("Konsole Environment Variable 
(\"$KONSOLE_TITLE_VAR\"): %v") },

so you could add "%v" to the tab title string and it would pick up 
KONSOLE_TITLE_VAR and insert it there. Kind of like what 
I18N_NOOP("Window Title Set by Shell: %w") already does, but instead of 
learning an escape sequence, or overwriting the title if you need it for 
something else, you can use KONSOLE_TITLE_VAR, with the added benefit 
that you could also modify it in fun ways using scripting and so on 
(something like updating the tab title to a changing counter or a flag 
attached to the return value of a program or script, or even just the 
output of `date`).

However, once I got into trying to do a proof of concept, I realized 
that the escape sequence is picked up through VT102 emulation, and that 
the "_environment" variable in Session.cpp is not the same thing as the 
ENV that bash uses when run in konsole.

So my question is: is what I'm trying to do at all feasible? Does it 
make sense for me to try to do this?

Thanks in advance!

And while I have your attention, I just filed 
https://bugs.kde.org/show_bug.cgi?id=413426 and was wondering if someone 
more familiar with the code could take a look at it, in case the fix is 
trivial. Thanks again

-Raphael




More information about the konsole-devel mailing list