kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
22.14k stars 907 forks source link

--temporary option from kitty command set-window-title throws TypeError #7342

Closed HerCerM closed 1 month ago

HerCerM commented 1 month ago

Describe the bug When trying to change the window title using the --temporary option of the kitty command set-window-title, a TypeError is thrown and the window title is not changed.

To Reproduce Steps to reproduce the behavior:

  1. Enable remote control, e.g. by turning it on at the command line: kitty --config NONE -o allow_remote_control=yes
  2. Try to change the window title temporarily: kitty @ set-window-title --temporary hello
  3. See error:
Traceback (most recent call last):
  File "lib/python3.11/kitty/boss.py", line 699, in _execute_remote_command
  File "lib/python3.11/kitty/remote_control.py", line 246, in handle_cmd
  File "lib/python3.11/kitty/rc/set_window_title.py", line 49, in response_from_kitty
  File "lib/python3.11/kitty/window.py", line 1110, in title_changed
  File "lib/python3.11/kitty/window.py", line 201, in process_title_from_child
TypeError: decoding str is not supported

Error: decoding str is not supported

The reproduction is consistent.

Screenshots If applicable, add screenshots to help explain your problem.

N/A.

Environment details

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here. 

On older versions of kitty, run kitty --debug-config instead

Output of Ctrl+Shift+F6:

kitty 0.33.1 (a5fea33757) created by Kovid Goyal
Darwin ENCEDCMIDLT0833.domain.name 22.6.0 Darwin Kernel Version 22.6.0: Wed Oct  4 21:25:26 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_X86_64 x86_64
ProductName:        macOS ProductVersion:       13.6.1 BuildVersion:        22G313
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config overrides:
  allow_remote_control yes

Config options different from defaults:
allow_remote_control yes
Removed shortcuts:
    cmd+, →  edit_config_file
    cmd+enter →  new_window
    cmd+h →  hide_macos_app
    cmd+k →  clear_terminal to_cursor active
    cmd+m →  minimize_macos_window
    cmd+n →  new_os_window
    cmd+q →  quit
    cmd+t →  new_tab
    cmd+w →  close_tab
    ctrl+cmd+, →  load_config_file
    ctrl+cmd+f →  toggle_fullscreen
    opt+cmd+h →  hide_macos_other_apps
    opt+cmd+r →  clear_terminal reset active
    opt+cmd+s →  toggle_macos_secure_keyboard_entry
    shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
    shift+cmd+[ →  previous_tab
    shift+cmd+] →  next_tab
    shift+cmd+d →  close_window
    shift+cmd+w →  close_os_window

Important environment variables seen by the kitty process:
    PATH                                /Users/hernancervera/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/Users/hernancervera/.luarocks/bin:/Users/hernancervera/.asdf/installs/lua/5.1/bin:/Users/hernancervera/.asdf/installs/lua/5.1/luarocks/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/CyberArk EPM.app/Contents/Helpers:/Applications/Wireshark.app/Contents/MacOS:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/kitty.app/Contents/MacOS:/Users/hernancervera/dev/spub:/Users/hernancervera/.local/bin:~/dev/chromedriver-mac-x64:/Users/hernancervera/dev/spri:/usr/local/sbin:/usr/local/mysql/bin:/Users/hernancervera/.asdf/installs/rust/1.67.1/bin:/usr/local/opt/fzf/bin
    LANG                                en_US.UTF-8
    EDITOR                              nvim
    SHELL                               /bin/zsh
    USER                                hernancervera

Additional context Documentation on --temporary from set-window-title as per kitty 0.33.1:

  --temporary
    By default, the title will be permanently changed and programs running in
    the window will not be able to change it again. If you want to allow other
    programs to change it afterwards, use this option.

This option was working at some older kitty version as I use it in a script.