mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
ssh kitten: Passthrough to ssh if run outside of kitty
Also, ensure that the ssh data request is only served if it is received over the tty of the correct kitty window.
This commit is contained in:
@@ -59,7 +59,8 @@ def dcs_to_kitty(type, payload):
|
||||
|
||||
def send_data_request():
|
||||
hostname = os.environ.get('HOSTNAME') or os.uname().nodename
|
||||
write_all(tty_fd, dcs_to_kitty('ssh', 'hostname={}:pwfile=PASSWORD_FILENAME:user={}:pw=DATA_PASSWORD'.format(hostname, getpass.getuser())))
|
||||
write_all(tty_fd, dcs_to_kitty(
|
||||
'ssh', 'id=REQUEST_ID:hostname={}:pwfile=PASSWORD_FILENAME:user={}:pw=DATA_PASSWORD'.format(hostname, getpass.getuser())))
|
||||
|
||||
|
||||
def debug(msg):
|
||||
|
||||
@@ -93,12 +93,10 @@ if [ -z "$HOME" ]; then HOME=~; fi
|
||||
if [ -z "$USER" ]; then USER=$(command whoami 2> /dev/null); fi
|
||||
|
||||
# ask for the SSH data
|
||||
data_password="DATA_PASSWORD"
|
||||
password_filename="PASSWORD_FILENAME"
|
||||
leading_data=""
|
||||
|
||||
init_tty && trap 'cleanup_on_bootstrap_exit' EXIT
|
||||
[ "$tty_ok" = "y" ] && dcs_to_kitty "ssh" "hostname="$hostname":pwfile="$password_filename":user="$USER":pw="$data_password""
|
||||
[ "$tty_ok" = "y" ] && dcs_to_kitty "ssh" "id="REQUEST_ID":hostname="$hostname":pwfile="PASSWORD_FILENAME":user="$USER":pw="DATA_PASSWORD""
|
||||
record_separator=$(printf "\036")
|
||||
|
||||
mv_files_and_dirs() {
|
||||
|
||||
Reference in New Issue
Block a user