Subject: Re: bug#44118: 28.0.50; Unwanted switch of foreground colour in *shell* buffer

From: Peter Dyballa <[email-masked]>
Date: Fri, 11 Dec 2020 16:23:10 +0100

> Am 11.12.2020 um 15:47 schrieb Lars Ingebrigtsen <[email-masked]>:
> 
> And the blue "root 235 /\" is your shell prompt?

Not really. I think it comes from shell-mode. In Apple Terminal it looks like this:

In ~/.emacs I have:

	.emacs:503: '(comint-prompt-regexp "^[a-z]+ [0-9]+ /\\\\ " t)
	.emacs:620: '(shell-prompt-pattern "^[a-z0-9]+ [0-9]+ /\\\\ ")
	.emacs:650: '(comint-highlight-prompt ((t (:background "khaki" :foreground "firebrick" :weight bold))))
	.emacs:670: '(minibuffer-prompt ((t (:background "yellow" :foreground "dark red" :weight bold))))

> Are there any ANSI codes in your prompt?

Yes. It's defined like this in ~/.tcshrc:

	 11 if ($?TERM) then
	 12     if (($TERM == xterm) | ($TERM == nxterm)) then
	 13         setenv TERM xterm-color
	 17     endif
	 43     if (($TERM == eterm-color) | ($TERM == xterm-256color) | ($TERM == xterm-color)) then
	 44         set     red="%{\033[1;47;31m%}"
	 45         set   green="%{\033[0;47;32m%}"
	 46         set  yellow="%{\033[1;33m%}"
	 47         set    blue="%{\033[1;34m%}"
	 48         set magenta="%{\033[1;35m%}"
	 49         set    cyan="%{\033[1;36m%}"
	 50         set   white="%{\033[0;37m%}"
	 51         set     end="%{\033[0m%}" # This is needed at the end... :(
	 52 #        set prompt      = "`echo \e[31\;47\;1m\j-$user` ! /\\ "
	 53         set prompt="${red}%n ! /\\ ${end} "
	 54 #       set prompt="${red}%n${blue}@%m ${white}%~ ${green}! /\\ ${end}"
	 55 #       set prompt="[${green}%n${blue}@%m ${white}%~ ]${end}"
	 56         unset red green yellow blue magenta cyan yellow white end
	 57     else
	 58         set prompt       = "`echo $user` ! /\\ "
	 59     endif
	126 endif

>  I don't quite see why that would affect the
> output here in this way, but it's one more thing that would be nice to
> eliminate -- could you use the default OS shell prompt and see whether
> that changes anything?

Alright, that'll be my next try! (In a new Terminal tab.)

--
Greetings

  Pete

We have to expect it, otherwise we would be surprised.