emacs sudo 打开文件卡住

日志

16:17:49.583230 tramp-accept-process-output (10) # *tramp/sudo root@archgotpl* 0 run nil
密码: 
16:17:49.583307 tramp-flush-connection-property (7) # locked
16:17:49.583370 tramp-process-one-action (5) # Looking for regexp "\(.*\(user\|login\)\( .*\)?: *\)\'" from remote shell
16:17:49.583430 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.583484 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.583574 tramp-process-one-action (5) # Looking for regexp "\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|decryption key\|encryption key\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|p\(?:a\(?:rola\|s\(?:ahitza\|s\(?: phrase\|code\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|in\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:\0? *\)\'" from remote shell
16:17:49.583658 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.583704 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.583769 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 [[:digit:]]+\).*\)\'" from remote shell
16:17:49.583818 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.583872 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585429 tramp-process-one-action (5) # Looking for regexp "\(^[^#$%>
]*[#$%>] *\)\'" from remote shell
16:17:49.585487 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585532 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585599 tramp-process-one-action (5) # Looking for regexp "\(\(?:^\|
\)[^]#$%>
]*#?[]#$%>] *\(e\[[[:digit:];]*[[:alpha:]] *\)*\)\'" from remote shell
16:17:49.585649 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585699 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585755 tramp-process-one-action (5) # Looking for regexp "\(\(Are you sure you want to continue connecting (yes/no\(?:\(?:/\[fingerprint]\)?)\?\)\)\s-*\)\'" from remote shell
16:17:49.585808 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585861 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.585917 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
16:17:49.585968 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586014 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586068 tramp-process-one-action (5) # Looking for regexp "\(\(TERM = (.*)\|Terminal type\? \[.*\]\)\s-*\)\'" from remote shell
16:17:49.586121 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586168 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586219 tramp-process-one-action (5) # Looking for regexp "\(Access granted\. Press Return to begin session\. \)\'" from remote shell
16:17:49.586266 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586320 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586367 tramp-process-one-action (5) # Looking for regexp "\(^
*Confirm user presence for key .*[
]*\)\'" from remote shell
16:17:49.586411 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586452 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.586498 tramp-process-one-action (5) # Looking for regexp "\(\)\'" from remote shell
16:17:49.586542 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.587573 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
16:17:49.587620 tramp-process-one-action (5) # Call ‘tramp-action-process-alive’
16:17:49.587675 tramp-get-connection-property (7) # locked nil; cache used: nil
16:17:49.587737 tramp-set-connection-property (7) # locked t
16:17:49.587809 tramp-flush-connection-property (7) # locked
16:17:49.587876 tramp-get-connection-property (7) # process-buffer nil; cache used: t
16:17:49.587938 tramp-process-actions (6) # 
密码: 
16:17:49.588110 tramp-get-connection-property (7) # prompt nil; cache used: nil
16:17:49.588171 tramp-process-sentinel (5) # Sentinel called: ‘#<process *tramp/sudo root@archgotpl*>’ ‘已杀死
’
16:17:49.588237 tramp-flush-connection-properties (7) # *tramp/sudo root@archgotpl* (temp-file password-vector session-timeout last-cmd-time)
16:17:49.588359 tramp-get-file-property (8) #  file-truename nil; inhibit: 10; cache used: nil; cached at: nil
16:17:49.588477 tramp-flush-directory-properties (8) # 
16:17:49.595690 tramp-get-connection-property (7) # process-buffer nil; cache used: t
16:17:49.595757 tramp-get-connection-property (7) # process-buffer nil; cache used: t
16:17:49.601487 tramp-process-actions (10) # 
  backtrace()
  tramp-error((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil) file-error "Timeout reached, see buffer ‘*tramp/sudo root@arch...")
  apply(tramp-error (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil) file-error "Timeout reached, see buffer ‘*tramp/sudo root@arch..." nil)
  tramp-process-actions(#<process *tramp/sudo root@archgotpl*> (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil) 1 ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-antispoof-regexp tramp-action-confirm-message) (tramp-security-key-confirm-regexp tramp-action-show-and-confirm-message) (tramp-process-alive-regexp tramp-action-process-alive)) 10)
  tramp-maybe-open-connection((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil))
  tramp-send-command((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil) "test 0 2>/dev/null; echo tramp_exit_status $?")
  tramp-send-command-and-check((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil) "test 0")
  tramp-get-test-command((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("archgotpl" 0 9 (tramp-default t)) nil "/etc/hosts" nil))
  tramp-run-test("-d" #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  tramp-sh-handle-file-directory-p(#("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  apply(tramp-sh-handle-file-directory-p #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  tramp-sh-file-name-handler(file-directory-p #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  apply(tramp-sh-file-name-handler file-directory-p #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  tramp-file-name-handler(file-directory-p #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  file-directory-p(#("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  find-file-noselect(#("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)) nil nil t)
  find-file(#("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)) t)
  funcall-interactively(find-file #("/sudo:root@archgotpl:/etc/hosts" 6 10 (tramp-default t) 11 20 (tramp-default t)) t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
16:17:49.601646 tramp-process-actions (1) # File error: Timeout reached, see buffer ‘*tramp/sudo root@archgotpl*’ for details
密码: 
16:18:19.648227 tramp-process-actions (3) # Waiting for prompts from remote shell...failed
16:18:19.648764 tramp-maybe-open-connection (3) # Opening connection nil for root@archgotpl using sudo...failed
16:18:19.649022 tramp-get-connection-property (7) # process-buffer nil; cache used: t
16:18:19.649317 tramp-get-file-property (8) #  file-truename nil; inhibit: 10; cache used: nil; cached at: nil
16:18:19.649457 tramp-flush-directory-properties (8) # 
16:18:19.649575 tramp-flush-connection-properties (7) # (tramp-file-name sudo root nil archgotpl nil nil nil) (null-device process-buffer first-password-request)

emacs28.2 archlinux 流程是emacs -Q “C-x C-f /sudo: :/” 使用zsh, ~/.zshrc, ~/.bashrc, /root/.zshrc , /root/.bashrc 都添加过[[ $TERM == “dumb” ]] && unsetopt zle && PS1='$ ’ && return,无效,直接ssh root@archgotpl 能进入

image

已解决,中文问题,设置tramp-password-prompt-regexp的正则匹配就行,匹配不了中文冒号导致的