From e99f461ce3263b75ce30c6e45cb483025a38c92d Mon Sep 17 00:00:00 2001 From: cubernetes Date: Fri, 16 Oct 2026 12:25:41 +0200 Subject: [PATCH] Set BASHRC_FORWARD variable and remove BASH_COMPLETION_VERSINFO workaround because I fixed it in nix --- bashrc-forward.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bashrc-forward.sh b/bashrc-forward.sh index 9978125..3e2161d 100644 --- a/bashrc-forward.sh +++ b/bashrc-forward.sh @@ -8,9 +8,8 @@ bashrc_get () { #-# Has some bugs, which is why we have to introduce this bashrc_get and that bashrc_load function, instead #-# of just embedding it inside the command substitution. echo "set -v" - #-# Setting BASH_COMPLETION_VERSINFO because nixos likes to hijack your .bashrc to run bash-completion.sh, which - #-# of course fails on remote systems, so we need a way to stop that from happening. Not perfect, but I'll accept the tradeoff. - echo "[ \"\${BASH_COMPLETION_VERSINFO-}\" ] || BASH_COMPLETION_VERSINFO=" + #-# Marker and variable so we can slice out the original .bashrc for relaying and have custom login only for forwarded .bashrc + echo "BASHRC_FORWARDED=1" #-# There's still a bug in bash at the moment regarding verbose mode not being turned on again after ${ :;} #-# https://www.mail-archive.com/bug-bash@gnu.org/msg35966.html #-# Therefore, be careful to use this new command substition syntax until it is fixed upstream! @@ -21,7 +20,7 @@ bashrc_get () { bashrc_load () { if [ "$_s" ]; then #-# Relay .bashrc if it has already been forwarded - : "${_s#*[B]ASH_COMPLETION_VERSINFO=[[:space:]]}" + : "${_s#*[B]ASHRC_FORWARDED=1[[:space:]]}" printf %s "${_%[[:space:]][s]et +v*}" else #-# Warning: Your `.bashrc` MUST NOT print any error messages at all!