On Sat, Jun 19, 2010 at 3:44 AM, Michael Albinus <[email protected]> wrote:
> Vinh Nguyen <[email protected]> writes:
>
>>> What do you mean with this? It should open a new bash shell, and show
>>> you the prompt. Like this:
>>>
>>> host:~> exec env ENV='' PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/bash
>>> albi...@host:~$
>>>
>>> Best regards, Michael.
>>
>> Yes, I was expecting that, but it didnt do so (I think). Tried it on
>> 2 different servers. I don't think it open a new bash shell because
>> entering 'exit' closes me out of the server.
>
> That's OK. "exec" means "replace the running shell by the called
> program", so it is OK that you exit directly from the opened bash.
>
> I suspect, that you set your prompt in ~/.bashrc. You should check,
> whether ~/.bashrc is handled by Tramp, for example by checking the used
> $TERM. Something like this at then end of ~/.bashrc:
>
> [ "$TERM" = "dumb" ] && PS1='$ '
>
So what are you suggesting I do here?
I see the following with $TERM in my .bashrc:
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
...
# If this is an xterm set the title to u...@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}...@\h: \w\a\]$PS1"
;;
*)
;;
esac
and on another remote host:
# If you're on an xterm, change the "u...@host" and directory in
# titlebar
if test "$TERM" == "xterm" ; then
PS1="\[\033]0;\...@\h:\w\007\]\@ \! \...@\h \w \n\$ "
else
# prompt will show: time command u...@host directory newline and $
PS1="\@ \! \...@\h \w \n\$ "
fi
...
## Emacs: ansi-term + tramp integration
## in ansi-term, ssh to this remote computer, can do C-x C-f and find file in RE
MOTE working directory
## http://www.enigmacurry.com/2008/12/26/emacs-ansi-term-tricks/
#Emacs ansi-term directory tracking
# track directory, username, and cwd for remote logons
if [ $TERM = eterm-color ]; then
function eterm-set-cwd {
$@
echo -e "\033AnSiTc" $(pwd)
}
# set hostname, user, and cwd
function eterm-reset {
echo -e "\033AnSiTu" $(whoami)
echo -e "\033AnSiTc" $(pwd)
echo -e "\033AnSiTh" $(hostname)
}
for temp in cd pushd popd; do
alias $temp="eterm-set-cwd $temp"
done
# set hostname, user, and cwd now
eterm-reset
fi
>> Vinh
>
> Best regards, Michael.
>
> PS: I'll start a trip tonight, being almost offline for the next 2
> weeks. If this proposal doesn't help, we must continue when I'll return.
Have a safe and fun trip. Hope this gets to you before you leave.
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel