-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/bash: Fix prompt regression in Emacs term mode #52458
Conversation
@@ -98,7 +98,12 @@ in | |||
if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then | |||
PROMPT_COLOR="1;31m" | |||
let $UID && PROMPT_COLOR="1;32m" | |||
PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] " | |||
if [ -n "$INSIDE_EMACS" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is emacs not already skipped in the condition above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. I misread.
# Emacs term mode doesn't support xterm title escape sequence (\e]0;) | ||
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " | ||
else | ||
PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between \\$
and \$
in that context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One would think \\$
should be an escaped backslash and a dollar sign. That's not how it evaluates, though.
Motivation for this change
Fix a regression with the prompt in Emacs
term
mode, introduced by #51678.Before:
After:
In gnome-terminal the prompt still updates the window title.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)