I'm trying to connect to host that doesn't have a `stty` binary through tramp. Unfortunately, once it finds a shell, tramp tries to run stty and fails, repeating this indefinitely.
I have put an stty binary which works on the remote host when I login with ssh, and have added it to PATH (root is on squashfs and read-only, stty binary is in /storage/bin). But trying to get tramp to also respect the PATH for stty is impossible. I have tried the following and all fail. ======= (setq tramp-verbose 10) (add-to-list 'tramp-remote-process-environment "PATH=/storage/bin:/usr/bin:/usr/sbin") (add-to-list 'tramp-remote-process-environment "ENV='PATH=/storage/bin:/usr/bin:/usr/sbin'") (add-to-list 'tramp-remote-path 'tramp-own-remote-path) (add-to-list 'tramp-remote-path "/storage/bin") (require 'trace) (trace-function-background 'tramp-send-string) ======= enabling trace on tramp-send-string, I can see that tramp-send-string does not respect the addition of PATH to tramp-remote-process-environment and only sends a predefined set of env vars to remote and excludes PATH, which is not helpful. This is the output I get when attempting connection: ======== ;; Emacs: 26.3 Tramp: 2.3.5.26.3 -*- mode: outline; -*- ;; Location: c:/Users/fengshaun/pkgs/emacs-26.3-x86_64/share/emacs/26.3/lisp/net/tramp.elc Git: nil 22:16:22.540930 tramp-get-connection-property (7) # ~ undef 22:16:22.540930 tramp-get-connection-property (7) # process-name nil 22:16:22.540930 tramp-get-connection-property (7) # process-name nil 22:16:22.540930 tramp-get-connection-property (7) # process-buffer nil 22:16:22.540930 tramp-get-connection-property (7) # process-buffer nil 22:16:22.540930 tramp-set-connection-property (7) # process-buffer nil 22:16:22.541930 tramp-maybe-open-connection (3) # Opening connection for falcon using plink... 22:16:22.543930 tramp-get-local-locale (7) # locale C 22:16:22.543930 tramp-get-connection-property (7) # login-args undef 22:16:22.543930 tramp-get-connection-property (7) # login-args undef 22:16:22.543930 tramp-get-connection-property (7) # process-name nil 22:16:22.543930 tramp-get-connection-property (7) # process-buffer nil 22:16:22.545930 tramp-set-connection-property (7) # vector (tramp-file-name plink nil nil falcon nil nil) 22:16:22.545930 tramp-maybe-open-connection (6) # C:/Users/fengshaun/pkgs/emacs-26.3-x86_64/libexec/emacs/26.3/x86_64-w64-mingw32/cmdproxy.exe 22:16:22.545930 tramp-get-connection-property (7) # vector (tramp-file-name plink nil nil falcon nil nil) 22:16:22.545930 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.545930 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.625935 tramp-accept-process-output (10) # *tramp/plink falcon* run t Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. c:\Users\fengshaun\AppData\Local\Temp> 22:16:22.625935 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.625935 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.625935 tramp-wait-for-regexp (6) # Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. c:\Users\fengshaun\AppData\Local\Temp> 22:16:22.625935 tramp-get-connection-property (7) # login-program undef 22:16:22.625935 tramp-get-connection-property (7) # login-args undef 22:16:22.625935 tramp-get-connection-property (7) # login-env undef 22:16:22.626935 tramp-get-connection-property (7) # async-args undef 22:16:22.626935 tramp-get-connection-property (7) # connection-timeout undef 22:16:22.626935 tramp-get-connection-property (7) # temp-file undef 22:16:22.626935 tramp-set-connection-property (7) # temp-file c:/Users/fengshaun/AppData/Local/Temp/tramp.ROzoob 22:16:22.630935 tramp-maybe-open-connection (3) # Sending command ‘plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit’ 22:16:22.630935 tramp-get-connection-property (7) # process-name nil 22:16:22.630935 tramp-get-connection-property (7) # remote-echo nil 22:16:22.630935 tramp-send-command (6) # plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit 22:16:22.630935 tramp-get-connection-property (7) # process-name nil 22:16:22.631935 tramp-get-connection-property (7) # chunksize nil 22:16:22.631935 tramp-set-connection-property (7) # last-cmd-time (24200 2582 631935 0) 22:16:22.631935 tramp-send-string (10) # plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit 22:16:22.631935 tramp-get-connection-property (7) # process-buffer nil 22:16:22.631935 tramp-set-connection-property (7) # first-password-request 22:16:22.632935 tramp-process-actions (3) # Waiting for prompts from remote shell... 22:16:22.681938 tramp-accept-process-output (10) # *tramp/plink falcon* run t plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit 22:16:22.681938 tramp-process-one-action (5) # Looking for regexp "\(.*\(user\|login\)\( .*\)?: *\)\'" from remote shell 22:16:22.681938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.681938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.681938 tramp-process-one-action (5) # Looking for regexp "\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: phrase\|code\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:\0? *\)\'" from remote shell 22:16:22.681938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.681938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-process-one-action (5) # Looking for regexp "\(^.*\(Connection \(?:\(?:clo\|refu\)sed\)\|Host key verification failed\.\|Login \(?:[Ii]ncorrect\)\|N\(?:ame or service not known\|o supported authentication methods left to try!\)\|Permission denied\|\(?:Sorry, try again\|Timeout, server not responding\)\.\).*\|^.*\(Received signal [0-9]+\).*\)\'" from remote shell 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-process-one-action (5) # Looking for regexp "\(^[^#$%> ]*[#$%>] *\)\'" from remote shell 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-process-one-action (5) # Looking for regexp "\(\(?:^\| \)[^]#$%> ]*#?[]#$%>] *\(\[[0-9;]*[a-zA-Z] *\)*\)\'" from remote shell 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.682938 tramp-process-one-action (5) # Looking for regexp "\(\(Are you sure you want to continue connecting (yes/no)\?\)\s-*\)\'" from remote shell 22:16:22.682938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-process-one-action (5) # Looking for regexp "\(\(\(?:Store key in cache\? (y/\|Update cached key\? (y/n, Return cancels connectio\)n)\)\s-*\)\'" from remote shell 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-process-one-action (5) # Looking for regexp "\(\(TERM = (.*)\|Terminal type\? \[.*\]\)\s-*\)\'" from remote shell 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-process-one-action (5) # Looking for regexp "\(\)\'" from remote shell 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-get-connection-property (7) # check-remote-echo nil 22:16:22.683938 tramp-process-one-action (5) # Call ‘tramp-action-process-alive’ 22:16:23.492985 tramp-accept-process-output (10) # *tramp/plink falcon* run t plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit #$ 22:16:23.492985 tramp-process-one-action (5) # Looking for regexp "\(.*\(user\|login\)\( .*\)?: *\)\'" from remote shell 22:16:23.492985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.492985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.493985 tramp-process-one-action (5) # Looking for regexp "\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: phrase\|code\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:\0? *\)\'" from remote shell 22:16:23.494985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.494985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.494985 tramp-process-one-action (5) # Looking for regexp "\(^.*\(Connection \(?:\(?:clo\|refu\)sed\)\|Host key verification failed\.\|Login \(?:[Ii]ncorrect\)\|N\(?:ame or service not known\|o supported authentication methods left to try!\)\|Permission denied\|\(?:Sorry, try again\|Timeout, server not responding\)\.\).*\|^.*\(Received signal [0-9]+\).*\)\'" from remote shell 22:16:23.495985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.495985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.495985 tramp-process-one-action (5) # Looking for regexp "\(^[^#$%> ]*[#$%>] *\)\'" from remote shell 22:16:23.495985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.496985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.496985 tramp-process-one-action (5) # Looking for regexp "\(\(?:^\| \)[^]#$%> ]*#?[]#$%>] *\(\[[0-9;]*[a-zA-Z] *\)*\)\'" from remote shell 22:16:23.496985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.496985 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.496985 tramp-process-one-action (5) # Call ‘tramp-action-succeed’ 22:16:23.497985 tramp-get-connection-property (7) # process-buffer nil 22:16:23.497985 tramp-process-actions (6) # plink -ssh -t falcon " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit #$ 22:16:23.497985 tramp-get-connection-property (7) # process-buffer nil 22:16:23.499985 tramp-process-actions (3) # Waiting for prompts from remote shell...done 22:16:23.501985 tramp-maybe-open-connection (3) # Found remote shell prompt on ‘falcon’ 22:16:23.501985 tramp-get-connection-property (7) # process-buffer nil 22:16:23.529987 tramp-get-connection-property (7) # remote-shell undef 22:16:23.530987 tramp-open-shell (5) # Opening remote shell ‘/bin/sh’... 22:16:23.530987 tramp-get-connection-property (7) # process-name nil 22:16:23.530987 tramp-get-connection-property (7) # remote-echo nil 22:16:23.530987 tramp-send-command (6) # exec env TERM='dumb' INSIDE_EMACS='26.3,tramp:2.3.5.26.3' ENV='PATH=/storage/bin:/usr/bin:/usr/sbin;HOME=/storage' HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh 22:16:23.530987 tramp-get-connection-property (7) # process-name nil 22:16:23.530987 tramp-get-connection-property (7) # chunksize nil 22:16:23.530987 tramp-set-connection-property (7) # last-cmd-time (24200 2583 530987 0) 22:16:23.531987 tramp-send-string (10) # exec env TERM='dumb' INSIDE_EMACS='26.3,tramp:2.3.5.26.3' ENV='PATH=/storage/bin:/usr/bin:/usr/sbin;HOME=/storage' HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh 22:16:23.531987 tramp-get-connection-property (7) # process-buffer nil 22:16:23.531987 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.531987 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.584990 tramp-accept-process-output (10) # *tramp/plink falcon* run t exec env TERM='dumb' INSIDE_EMACS='26.3,tramp:2.3.5.26.3' ENV='PATH=/storage/ bin:/usr/bin:/usr/sbin;HOME=/storage' HISTFILE=~/.tramp_history PROMPT_COMMAND=' ' PS1=\#\$\ PS2='' PS3='' /bin/sh #$ 22:16:23.584990 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.584990 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.584990 tramp-wait-for-regexp (6) # exec env TERM='dumb' INSIDE_EMACS='26.3,tramp:2.3.5.26.3' ENV='PATH=/storage/ bin:/usr/bin:/usr/sbin;HOME=/storage' HISTFILE=~/.tramp_history PROMPT_COMMAND=' ' PS1=\#\$\ PS2='' PS3='' /bin/sh #$ 22:16:23.584990 tramp-get-connection-property (7) # process-name nil 22:16:23.584990 tramp-get-connection-property (7) # process-name nil 22:16:23.585990 tramp-get-connection-property (7) # process-buffer nil 22:16:23.585990 tramp-get-connection-property (7) # last-cmd-time (24200 2583 530987 0) 22:16:23.585990 tramp-get-connection-property (7) # process-name nil 22:16:23.585990 tramp-get-connection-property (7) # remote-echo nil 22:16:23.585990 tramp-send-command (6) # (cd ~/) 2>/dev/null; echo tramp_exit_status $? 22:16:23.585990 tramp-get-connection-property (7) # process-name nil 22:16:23.585990 tramp-get-connection-property (7) # chunksize nil 22:16:23.585990 tramp-set-connection-property (7) # last-cmd-time (24200 2583 585990 0) 22:16:23.585990 tramp-send-string (10) # (cd ~/) 2>/dev/null; echo tramp_exit_status $? 22:16:23.586990 tramp-get-connection-property (7) # process-buffer nil 22:16:23.586990 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.586990 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.638993 tramp-accept-process-output (10) # *tramp/plink falcon* run t (cd ~/) 2>/dev/null; echo tramp_exit_status $? tramp_exit_status 0 #$ 22:16:23.638993 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.638993 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.638993 tramp-wait-for-regexp (6) # (cd ~/) 2>/dev/null; echo tramp_exit_status $? tramp_exit_status 0 #$ 22:16:23.638993 tramp-get-connection-property (7) # process-buffer nil 22:16:23.639993 tramp-get-connection-property (7) # process-name nil 22:16:23.639993 tramp-set-connection-property (7) # remote-shell /bin/sh 22:16:23.639993 tramp-open-shell (5) # Opening remote shell ‘/bin/sh’...done 22:16:23.639993 tramp-open-connection-setup-interactive-shell (5) # Setting up remote shell environment 22:16:23.639993 tramp-get-connection-property (7) # process-name nil 22:16:23.639993 tramp-get-connection-property (7) # remote-echo nil 22:16:23.640993 tramp-send-command (6) # stty -inlcr -onlcr -echo kill '^U' erase '^H' 22:16:23.640993 tramp-get-connection-property (7) # process-name nil 22:16:23.640993 tramp-get-connection-property (7) # chunksize nil 22:16:23.640993 tramp-set-connection-property (7) # last-cmd-time (24200 2583 640993 0) 22:16:23.640993 tramp-send-string (10) # stty -inlcr -onlcr -echo kill '^U' erase '^H' 22:16:23.640993 tramp-get-connection-property (7) # process-buffer nil 22:16:23.640993 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.641993 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.693996 tramp-accept-process-output (10) # *tramp/plink falcon* run t stty -inlcr -onlcr -echo kill '^U' erase '^H' /bin/sh: stty: not found #$ 22:16:23.693996 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.693996 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.693996 tramp-wait-for-regexp (6) # stty -inlcr -onlcr -echo kill '^U' erase '^H' /bin/sh: stty: not found #$ 22:16:23.693996 tramp-get-connection-property (7) # process-name nil 22:16:23.693996 tramp-get-connection-property (7) # remote-echo nil 22:16:23.693996 tramp-send-command (6) # echo foo 22:16:23.694996 tramp-get-connection-property (7) # process-name nil 22:16:23.694996 tramp-get-connection-property (7) # chunksize nil 22:16:23.694996 tramp-set-connection-property (7) # last-cmd-time (24200 2583 694996 0) 22:16:23.694996 tramp-send-string (10) # echo foo 22:16:23.694996 tramp-get-connection-property (7) # process-buffer nil 22:16:23.694996 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.694996 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.747999 tramp-accept-process-output (10) # *tramp/plink falcon* run t echo foo foo #$ 22:16:23.747999 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.747999 tramp-get-connection-property (7) # check-remote-echo nil 22:16:23.747999 tramp-wait-for-regexp (6) # echo foo foo #$ 22:16:23.747999 tramp-set-connection-property (7) # remote-echo t 22:16:23.747999 tramp-open-connection-setup-interactive-shell (5) # Remote echo still on. Ok. 22:16:23.747999 tramp-get-connection-property (7) # process-name nil 22:16:23.748999 tramp-get-connection-property (7) # remote-echo t 22:16:23.748999 tramp-set-connection-property (7) # check-remote-echo t 22:16:23.748999 tramp-send-command (6) # _echostty icanon erase ^H cols 32767_echo 22:16:23.748999 tramp-get-connection-property (7) # process-name nil 22:16:23.748999 tramp-get-connection-property (7) # chunksize nil 22:16:23.748999 tramp-set-connection-property (7) # last-cmd-time (24200 2583 748999 0) 22:16:23.748999 tramp-send-string (10) # _echostty icanon erase ^H cols 32767_echo 22:16:23.748999 tramp-get-connection-property (7) # process-buffer nil 22:16:23.748999 tramp-get-connection-property (7) # check-remote-echo t 22:16:23.749999 tramp-get-connection-property (7) # check-remote-echo t 22:16:23.803002 tramp-accept-process-output (10) # *tramp/plink falcon* run t _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:23.803002 tramp-get-connection-property (7) # check-remote-echo t 22:16:23.803002 tramp-get-connection-property (7) # check-remote-echo t 22:16:24.803060 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:24.803060 tramp-get-connection-property (7) # check-remote-echo t 22:16:24.803060 tramp-get-connection-property (7) # check-remote-echo t 22:16:25.803117 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:25.803117 tramp-get-connection-property (7) # check-remote-echo t 22:16:25.803117 tramp-get-connection-property (7) # check-remote-echo t 22:16:26.804174 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:26.804174 tramp-get-connection-property (7) # check-remote-echo t 22:16:26.804174 tramp-get-connection-property (7) # check-remote-echo t 22:16:27.804231 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:27.804231 tramp-get-connection-property (7) # check-remote-echo t 22:16:27.804231 tramp-get-connection-property (7) # check-remote-echo t 22:16:28.804288 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:28.804288 tramp-get-connection-property (7) # check-remote-echo t 22:16:28.804288 tramp-get-connection-property (7) # check-remote-echo t 22:16:29.804346 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:29.804346 tramp-get-connection-property (7) # check-remote-echo t 22:16:29.804346 tramp-get-connection-property (7) # check-remote-echo t 22:16:30.804403 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:30.804403 tramp-get-connection-property (7) # check-remote-echo t 22:16:30.804403 tramp-get-connection-property (7) # check-remote-echo t 22:16:31.804460 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ 22:16:31.804460 tramp-get-connection-property (7) # check-remote-echo t 22:16:31.804460 tramp-get-connection-property (7) # check-remote-echo t 22:16:32.804517 tramp-accept-process-output (10) # *tramp/plink falcon* run nil _echo[J[J[J[J[Jstty icanon erase ^H cols 32767_echo[J[J[J[J[J /bin/sh: stty: not found #$ ...repeated many more times until operation was cancelled with C-g 22:22:29.989947 tramp-get-connection-property (7) # check-remote-echo t 22:22:29.989947 tramp-get-connection-property (7) # check-remote-echo t 22:22:30.903999 tramp-maybe-open-connection (3) # Opening connection for falcon using plink...failed 22:22:30.914000 tramp-get-file-property (8) # file-truename nil 22:22:30.915000 tramp-flush-directory-property (8) # 22:22:30.915000 tramp-get-connection-property (7) # process-name nil 22:22:30.915000 tramp-get-connection-property (7) # process-name nil 22:22:30.915000 tramp-flush-connection-property (7) # *tramp/plink falcon* (vector temp-file last-cmd-time remote-shell remote-echo check-remote-echo) 22:22:30.915000 tramp-get-connection-property (7) # process-name nil 22:22:30.926001 tramp-flush-connection-property (7) # (tramp-file-name plink nil nil falcon nil nil nil) (process-buffer first-password-request) 22:22:30.926001 tramp-get-connection-property (7) # process-buffer nil 22:22:30.927001 tramp-file-name-handler (1) # Interrupt received in operation (expand-file-name /plink:falcon: nil) ======== And tramp-send-string trace. Notice PATH env var is missing from what is being sent, but ENV is modified appropriately. ======== ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "plink -ssh -t falcon \" env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh \" && exit || exit") 1 <- tramp-send-string: nil ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "exec env TERM='dumb' INSIDE_EMACS='26.3,tramp:2.3.5.26.3' ENV='PATH=/storage/bin:/usr/bin:/usr/sbin;HOME=/storage' HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=\\#\\$\\ PS2='' PS3='' /bin/sh ") 1 <- tramp-send-string: nil ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "(cd ~/) 2>/dev/null; echo tramp_exit_status $?") 1 <- tramp-send-string: nil ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "stty -inlcr -onlcr -echo kill '^U' erase '^H'") 1 <- tramp-send-string: nil ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "echo foo") 1 <- tramp-send-string: nil ====================================================================== 1 -> (tramp-send-string (tramp-file-name "plink" nil nil "falcon" nil "" nil) "_echostty icanon erase ^H cols 32767_echo") 1 <- tramp-send-string: nil ======== I would expect tramp to fail fast and fail hard when stty or any other required binary is not available with an appropriate message. Also being able to specify alternate PATH is important in this case to find such binaries. I'm not sure how to fix this issue and would appreciate any help. -- fengshaun
