Wednesday, August 22, 2007

Various bugs

  1. TRAMP and zsh don't get along. In particular, it appears that the PROMPT_SP zsh option (which outputs special characters to mark command output that doesn't end in a newline) causes the zsh prompt to no longer match the shell-prompt-pattern emacs variable, which is set to "^[^#$%>\n]*[#$%>] *" by default. I added the following hack to my .emacs file to fix the problem:
    (eval-after-load "tramp"
    '(setcdr (assoc 'tramp-login-args (assoc "sudo" tramp-methods))
    '((("-u" "%u") ("-p" "Password:" "/bin/sh"))))

  2. Connecting to some servers via ssh was taking way too long, around 10 seconds. Running "strace ssh -vvv" showed that the program was hanging while trying to do a reverse DNS lookup on the IP address of the server (i.e. getnameinfo). The culprits were the mDNS resolver (libnss-mdns) and Avahi daemon — they were broadcasting reverse mDNS lookup requests to the local network and timing out very slowly. The fix was easy: remove the "mdns" entry from the "hosts:" line in /etc/nsswitch.conf (I love Linux...).

No comments: