tcsh$ cd ~
^[]0;sallred@calamity:/home/sallred^G
tcsh$ cd bin
^[]0;sallred@calamity:/home/sallred/bin^G
tcsh$
What is this cruft that is appearing before my prompt (or perhaps more appropriately, after my command) and how can I remove it?
tcsh$ cd ~
^[]0;sallred@calamity:/home/sallred^G
tcsh$ cd bin
^[]0;sallred@calamity:/home/sallred/bin^G
tcsh$
What is this cruft that is appearing before my prompt (or perhaps more appropriately, after my command) and how can I remove it?
You might want to look at this question. Basically you need to avoid creating aliases for commands or prompts that assume that every shell is running where there is a window title to be set. Or create functions that do things differently depending on what kind of terminal they find themselves in.
As part of my bash initialization I do something like:
case "$TERM" in
(emacs)
# Emacs shell differences ...
;;
(xterm*|dtterm*|linux|screen)
# Embed working directory in window title
PROMPT_COMMAND='echo -ne "\033]0;${SSH_TTY:+${HOSTNAME%%.*}:}${PWD##*/}\007"'
;;
*)
# Unrecognized terminal types get nothing
;;
esac
You need tcsh's precmd to do something equivalent.
prompt
in your .cshrc (or equivalent) file? – glucas Nov 12 '14 at 15:27set prompt "\ntcsh$ "
This stuff only appears from within emacs. Additionally, there is nothing in my rc file that matches this general pattern:.*:.*@.*
. – Sean Allred Nov 12 '14 at 15:34xterm
window title? – Constantine Nov 12 '14 at 16:31alias precmd 'echo -n "\033]0;${USER}@${HOST}:${PWD}\007"'
), but is there any way to get Emacs to ignore or override this? – Sean Allred Nov 12 '14 at 16:43comint-preoutput-filter-functions
. SeeC-h v comint-preoutput-filter-functions
. You should be able to write a filter that removes the cruft before it gets inserted into ashell-mode
buffer.term-mode
is not based oncomint
, though. – Constantine Dec 11 '14 at 19:35