]> git.eshelyaron.com Git - emacs.git/commitdiff
* tramp.texi (Remote shell setup): New item "Interactive shell
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 4 Nov 2010 13:30:20 +0000 (14:30 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 4 Nov 2010 13:30:20 +0000 (14:30 +0100)
prompt".  Reported by Christian Millour <cm@abtela.com>.
(Remote shell setup, Remote processes): Use @code{} for
environment variables.

doc/misc/ChangeLog
doc/misc/tramp.texi

index ccd4b14cf69e5f07f331ed01868bd9b3757dc986..89e16eaa30825d007186bdc680ab066ea6e5d142 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi (Remote shell setup): New item "Interactive shell
+       prompt".  Reported by Christian Millour <cm@abtela.com>.
+       (Remote shell setup, Remote processes): Use @code{} for
+       environment variables.
+
 2010-11-03  Glenn Morris  <rgm@gnu.org>
 
        * ediff.texi (Quick Help Commands, Miscellaneous):
index 2c82becf6aea84906ed4a04990e2fb2f3409575a..6a77c138404fd00b34f17379c7869f252cf8ac01 100644 (file)
@@ -1942,7 +1942,7 @@ understand this syntax and will emit a syntax error when it reaches
 this line.
 
 Another example is the tilde (@code{~}) character, say when adding
-@file{~/bin} to @code{$PATH}.  Many Bourne shells will not expand this
+@file{~/bin} to @code{PATH}.  Many Bourne shells will not expand this
 character, and since there is usually no directory whose name consists
 of the single character tilde, strange things will happen.
 
@@ -1969,6 +1969,38 @@ shell is Bourne-ish already, then it might be prudent to omit the
 @command{exec /bin/sh} step.  But how to find out if the shell is
 Bourne-ish?
 
+
+@item Interactive shell prompt
+
+@value{tramp} redefines the shell prompt in order to parse the shell's
+output robustly.  When calling an interactive shell by @kbd{M-x
+shell}, this doesn't look nice.
+
+You can redefine the shell prompt by checking the environment variable
+@code{INSIDE_EMACS}, which is set by @value{tramp}, in your startup
+script @file{~/.emacs_SHELLNAME}. @code{SHELLNAME} might be the string
+@code{bash} or similar, in case of doubt you could set it the
+environment variable @code{ESHELL} in your @file{.emacs}:
+
+@lisp
+(setenv "ESHELL" "bash")
+@end lisp
+
+Your file @file{~/.emacs_SHELLNAME} could contain code like
+
+@example
+# Reset the prompt for remote Tramp shells.
+if [ "$@{INSIDE_EMACS/*tramp*/tramp@}" == "tramp" ] ; then
+   PS1="[\u@@\h \w]$ "
+fi
+@end example
+
+@ifinfo
+@ifset emacs
+@xref{Interactive Shell, , , @value{emacsdir}}.
+@end ifset
+@end ifinfo
+
 @end table
 
 
@@ -2493,7 +2525,7 @@ Adding an entry can be performed via @code{add-to-list}:
 Changing or removing an existing entry is not encouraged.  The default
 values are chosen for proper @value{tramp} work.  Nevertheless, if for
 example a paranoid system administrator disallows changing the
-@var{$HISTORY} environment variable, you can customize
+@code{HISTORY} environment variable, you can customize
 @code{tramp-remote-process-environment}, or you can apply the
 following code in your @file{.emacs}:
 
@@ -2512,7 +2544,7 @@ integrate them as well.  @xref{Bug Reports}.
 
 If you want to run a remote program, which shall connect the X11
 server you are using with your local host, you can set the
-@var{$DISPLAY} environment variable on the remote host:
+@code{DISPLAY} environment variable on the remote host:
 
 @lisp
 (add-to-list 'tramp-remote-process-environment