From ac773d16076a17c895a39d493d2c91e8f2df3dc9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 21 Aug 2019 20:46:20 -0400 Subject: [PATCH] nixos/zsh: Fix tramp support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For a long time, TRAMP has not worked with ZSH NixOS servers. I thought I fixed this in 0740f57e63af61694d14796286cb9204, but now realize that was only half the problem. For TRAMP to start working again ‘unsetopt zle’ was needed, otherwise the connection would hang. In addition, I have a few more settings added that can apparenty interfere with these settings. --- nixos/modules/programs/zsh/zsh.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index 3cbfd8fa4d32..27f4166e1005 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -69,9 +69,7 @@ in promptInit = mkOption { default = '' - if [ "$TERM" != dumb ]; then - autoload -U promptinit && promptinit && prompt walters && setopt prompt_sp - fi + autoload -U promptinit && promptinit && prompt walters && setopt prompt_sp ''; description = '' Shell script code used to initialise the zsh prompt. @@ -213,6 +211,15 @@ in ${cfg.promptInit} + # Need to disable features to support TRAMP + if [ "$TERM" = dumb ]; then + unsetopt zle prompt_cr prompt_subst + unfunction precmd preexec + unset RPS1 RPROMPT + PS1='$ ' + PROMPT='$ ' + fi + # Read system-wide modifications. if test -f /etc/zshrc.local; then . /etc/zshrc.local