emacs - Shell prompt repeating when using ssh in ansi-term -
when use ssh login ubuntu 12.04 machine ansi-term session in emacs prompt displays incorrectly:
0;ubuntu@jumplin: ~ubuntu@jumplin:~$
this should following:
ubuntu@jumplin:~$
i've tried few of suggestions in relation utf-8 , colour support don't seem working (colour works fine in ansi-term):
strange characters in ansi-term in emacs
i think might have unsupported ansi escape code or that, i'm not sure - value of ps1 terminal session is:
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
any advice appreciated :) seem bit lost when strange characters show in terminal sessions.
\[\e]0;\u@\h: \w\a\]
in prompt configure xterm(?)'s title bar. though ansi colorization supported ansi-term
, escape sequences manipulate title bar not. why see prompt repeated twice - first section supposed go title bar.
so either remove first sequence ps1 or similar suggested in bash prompt howto:
function proml { case $term in xterm*) local titlebar='\[\033]0;\u@\h:\w\007\]' ;; *) local titlebar='' ;; esac ps1="${titlebar}\ [\$(date +%h%m)]\ [\u@\h:\w]\ \$ " ps2='> ' ps4='+ ' }
you can test if in ansi-term
, term
equal eterm-color
.
Comments
Post a Comment