khal icon indicating copy to clipboard operation
khal copied to clipboard

khal interactive: set terminal title

Open ddevault opened this issue 2 years ago • 3 comments

https://tldp.org/HOWTO/Xterm-Title-3.html

ddevault avatar Feb 13 '23 09:02 ddevault

What title(s) do you expect to see?

WhyNotHugo avatar Feb 13 '23 10:02 WhyNotHugo

Simply "khal" would be sufficient

ddevault avatar Feb 13 '23 10:02 ddevault

Keep in mind that you can configure a shell to do this for all commands.

E.g.: for zsh:

preexec () {
  print -Pn "\e]0;$TERM [%~]: $1\a"
}

This seems like a good idea anyway. The simplest approach with Python is:

print('\33]0;khal\a', end='', flush=True)

I don't think there's a single entry point where we can add this though, there's a few different ways to enter interactive mode.

That the title would remain as khal after we exit, unless we explicitly set it back to "", probably with atexit.

WhyNotHugo avatar Feb 13 '23 10:02 WhyNotHugo