You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Print additional information inside a nix-shell environment
function fish_right_prompt
$(which nix-shell-info)
printf " "
end
Here's a copy-pasted terminal session involving different fish_right_prompts' effects on text selection. Highlight the entire code block and observe that the prompt line has a ton of trailing whitespace, depending on the value of fish_right_prompt.
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
~ λ echo "start with a shell without the prompt added by --info-right"
start with a shell without the prompt added by --info-right
~ λ
~ λ function fish_right_prompt
end
~ λ echo "notice that had no effect on text selection"
notice that had no effect on text selection
~ λ
~ λ function fish_right_prompt
printf " "
end
~ λ echo "see how that makes the selection copy the entire line? it's because it inserted a single-space right-prmopt instead of nothing"
see how that makes the selection copy the entire line? it's because it inserted a single-space right-prmopt instead of nothing
~ λ
~ λ function fish_right_prompt
nix-shell-info
end
~ λ echo "nix-shell-info prints nothing by default, so text selection is still fine"
nix-shell-info prints nothing by default, so text selection is still fine
~ λ
~ λ function fish_right_prompt
nix-shell-info
printf " "
end
~ λ echo "here's the actual right prompt generated by any-nix-shell, just to illustrate"
here's the actual right prompt generated by any-nix-shell, just to illustrate
This trailing whitespace is really bothersome when copy/pasting from the terminal into, say... GitHub issue descriptions!
Either we should delete the printf " " entirely, or make it conditional on nix-shell-info outputting something.
The text was updated successfully, but these errors were encountered:
Relevant code:
any-nix-shell/bin/any-nix-shell
Lines 61 to 65 in c8536fa
Here's a copy-pasted terminal session involving different
fish_right_prompt
s' effects on text selection. Highlight the entire code block and observe that the prompt line has a ton of trailing whitespace, depending on the value offish_right_prompt
.This trailing whitespace is really bothersome when copy/pasting from the terminal into, say... GitHub issue descriptions!
Either we should delete the
printf " "
entirely, or make it conditional onnix-shell-info
outputting something.The text was updated successfully, but these errors were encountered: