From 065c6ed96e0c89345ad5003656f8c2160f740ec1 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Mon, 19 Aug 2019 22:50:49 +0000 Subject: nixos: zsh: setopt prompt_sp to workaround a zsh bug See #38535, properly fixing the prompt seems complicated, and this seems to work in all the ttys I checked. Suggested by @Mic92. --- nixos/modules/programs/zsh/zsh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules/programs/zsh/zsh.nix') diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index bd1a7768066..3cbfd8fa4d3 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -70,7 +70,7 @@ in promptInit = mkOption { default = '' if [ "$TERM" != dumb ]; then - autoload -U promptinit && promptinit && prompt walters + autoload -U promptinit && promptinit && prompt walters && setopt prompt_sp fi ''; description = '' -- cgit 1.4.1 From ac773d16076a17c895a39d493d2c91e8f2df3dc9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 21 Aug 2019 20:46:20 -0400 Subject: 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(-) (limited to 'nixos/modules/programs/zsh/zsh.nix') diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index 3cbfd8fa4d3..27f4166e100 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 -- cgit 1.4.1