[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
term.el and Bash interaction
From: |
Mark Plaksin |
Subject: |
term.el and Bash interaction |
Date: |
Wed, 02 Nov 2005 09:39:17 -0500 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0 (gnu/linux) |
Bash's magic for telling term.el what directory it's in overrides the
default-directory set in term-handle-ansi-terminal-messages. It would be
better if term-handle-ansi-terminal-messages overrode what bash says.
If the EMACS environment variable contains "term" Bash assumes it's running
inside of Emacs in a term.el window and sends "\032/the/dir/bash/is/in\n"
to tell term.el what directory it is in. term.el uses this to set
default-directory.
You can send other escape sequences to term.el to make it set
default-directory. For example, 'ESCAnSiTc /home/happy' tells term.el I'm
in /home/happy. Besides 'c' for directory you can use 'h' for host and 'u'
for user. I use all of this to set default-directory to something
TRAMP-friendly in terms on remote machines. That way I can use C-x C-f to
edit files on the remote host (whether I'm a regular user or root).
I can't find a combination of AnSiT settings which sets default-directory
correctly when you are root on the machine on which Emacs is running. In
that case I pretend that I'm on a remote machine and make default-directory
be something like: /multi:ssh:address@hidden:su:address@hidden:/home/happy/
term-handle-ansi-terminal-messages sets default-directory to this but
term.el immediately resets default-directory to what Bash told it. Since
Bash's behavior is automatic and have to go out of your way to send AnSiT
sequences, I think the AnSiT sequences should take precedence.
- term.el and Bash interaction,
Mark Plaksin <=