3

I'm searching a way to change my terminal title with curses.

Actually i do it like that:

sys.stdout.write("\x1b]2;%s\x07" % title)

but i'm searching a more general way to do it.

detroa
  • 31
  • 1
  • 2
  • According to [the mailing list](http://lists.gnu.org/archive/html/bug-ncurses/2004-04/msg00006.html), there is none (except maybe use `putp()`). – Frédéric Hamidi Apr 30 '14 at 12:51
  • Yes, I saw that, but this is from 2004, it's a bit old. I was hoping this would be implemented now. :( – detroa Apr 30 '14 at 12:55
  • Sometimes the 2 needs to be replaced by 0 - see http://stackoverflow.com/questions/10919696/change-konsole-title-via-python – cup Apr 30 '14 at 14:00
  • It's not part of the curses standard. PDCurses has PDC_set_title(), for some of its supported platforms. – William McBrine Apr 30 '14 at 19:54
  • I find sys.stdout.write fails to update the title at all. @FrédéricHamidi `putp()` just throws `TypeError: a bytes-like object is required, not 'str'` – Zoey Hewll Oct 02 '16 at 04:34

0 Answers0