Nicer error message when user tries to run kitten with allow_remote_control from command line

This commit is contained in:
Kovid Goyal 2025-06-22 09:26:54 +05:30
parent bb4e8ffef0
commit 909671f508
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -70,6 +70,8 @@ class KittenUI:
return
if self.allow_remote_control:
self.to = os.environ.get('KITTY_LISTEN_ON', '')
if not self.to:
raise ValueError('Remote control not enabled, this kitten should be run via a map in kitty.conf, not from the command line')
self.rc_fd = int(self.to.partition(':')[-1])
os.set_inheritable(self.rc_fd, False)
if (self.remote_control_password or self.remote_control_password == '') and not self.password: