Fix parsing of env vars in bootstrap.py

This commit is contained in:
Kovid Goyal 2022-03-06 15:05:40 +05:30
parent a1ade8fc42
commit 00d2a8527f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import io
import os
import pwd
import select
import shlex
import shutil
import subprocess
import sys
@ -62,7 +63,12 @@ def send_data_request():
def debug(msg):
write_all(tty_fd, dcs_to_kitty('print', 'debug: {}'.format(msg)))
data = dcs_to_kitty('print', 'debug: {}'.format(msg))
if tty_fd == -1:
with open(os.ctermid(), 'wb') as fl:
write_all(fl.fileno(), data)
else:
write_all(tty_fd, data)
def apply_env_vars(raw):
@ -74,6 +80,7 @@ def apply_env_vars(raw):
key, val = parts[0], ''
else:
key, val = parts
val = shlex.split(val)[0]
os.environ[key] = val
for line in raw.splitlines():

View File

@ -73,7 +73,7 @@ else
}
fi
debug() { dcs_to_kitty "print" "debug $1"; }
debug() { dcs_to_kitty "print" "debug: $1"; }
echo_via_kitty() { dcs_to_kitty "echo" "$1"; }
if [ -z "$HOSTNAME" ]; then