mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
ssh kitten: Allow using absolute paths for the location of transferred data
Fixes #5607
This commit is contained in:
@@ -205,7 +205,10 @@ def get_data():
|
||||
with open(tdir + '/data.sh') as f:
|
||||
env_vars = f.read()
|
||||
apply_env_vars(env_vars)
|
||||
data_dir = os.path.join(HOME, os.environ.pop('KITTY_SSH_KITTEN_DATA_DIR'))
|
||||
data_dir = os.environ.pop('KITTY_SSH_KITTEN_DATA_DIR')
|
||||
if not os.path.isabs(data_dir):
|
||||
data_dir = os.path.join(HOME, data_dir)
|
||||
data_dir = os.path.abspath(data_dir)
|
||||
shell_integration_dir = os.path.join(data_dir, 'shell-integration')
|
||||
compile_terminfo(tdir + '/home')
|
||||
move(tdir + '/home', HOME)
|
||||
|
||||
@@ -103,7 +103,10 @@ untar_and_read_env() {
|
||||
. "$tdir/bootstrap-utils.sh"
|
||||
. "$tdir/data.sh"
|
||||
[ -z "$KITTY_SSH_KITTEN_DATA_DIR" ] && die "Failed to read SSH data from tty"
|
||||
data_dir="$HOME/$KITTY_SSH_KITTEN_DATA_DIR"
|
||||
case "$KITTY_SSH_KITTEN_DATA_DIR" in
|
||||
/*) data_dir="$KITTY_SSH_KITTEN_DATA_DIR" ;;
|
||||
*) data_dir="$HOME/$KITTY_SSH_KITTEN_DATA_DIR"
|
||||
esac
|
||||
shell_integration_dir="$data_dir/shell-integration"
|
||||
unset KITTY_SSH_KITTEN_DATA_DIR
|
||||
login_shell="$KITTY_LOGIN_SHELL"
|
||||
|
||||
Reference in New Issue
Block a user