diff options
| author | Michael Albinus | 2018-05-29 12:28:01 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-05-29 12:28:01 +0200 |
| commit | 6e5f19ada410a176eb36b0742fe45b3f5c80b710 (patch) | |
| tree | 3ccbb044c14917a3505cad264c90905750e75a47 /doc/misc | |
| parent | e8912d5be9180e661273706782473919368a0b67 (diff) | |
| download | emacs-6e5f19ada410a176eb36b0742fe45b3f5c80b710.tar.gz emacs-6e5f19ada410a176eb36b0742fe45b3f5c80b710.zip | |
Fix Bug#31605
* doc/misc/tramp.texi (All): Add @vindex entries for
environment variables.
(Remote shell setup): New items `tramp-terminal-type' and
"Determining a Tramp session".
(Frequently Asked Questions): Adapt zsh example. (Bug#31605)
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/tramp.texi | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f78124fdcde..2960368447e 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -1020,6 +1020,7 @@ can. | |||
| 1020 | @cindex android (with adb method) | 1020 | @cindex android (with adb method) |
| 1021 | 1021 | ||
| 1022 | @vindex tramp-adb-program | 1022 | @vindex tramp-adb-program |
| 1023 | @vindex PATH@r{, environment variable} | ||
| 1023 | This method uses Android Debug Bridge program for accessing Android | 1024 | This method uses Android Debug Bridge program for accessing Android |
| 1024 | devices. The Android Debug Bridge must be installed locally for | 1025 | devices. The Android Debug Bridge must be installed locally for |
| 1025 | @value{tramp} to work. Some GNU/Linux distributions provide Android | 1026 | @value{tramp} to work. Some GNU/Linux distributions provide Android |
| @@ -1877,15 +1878,64 @@ example below: | |||
| 1877 | Similar localization may be necessary for handling wrong password | 1878 | Similar localization may be necessary for handling wrong password |
| 1878 | prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}. | 1879 | prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}. |
| 1879 | 1880 | ||
| 1881 | @item @code{tramp-terminal-type} | ||
| 1882 | @vindex tramp-terminal-type | ||
| 1883 | @vindex TERM@r{, environment variable} | ||
| 1884 | |||
| 1885 | @value{tramp} uses the user option @code{tramp-terminal-type} to set | ||
| 1886 | the remote environment variable @env{TERM} for the shells it runs. | ||
| 1887 | Per default, it is @samp{"dumb"}, but this could be changed. A dumb | ||
| 1888 | terminal is best suited to run the background sessions of | ||
| 1889 | @value{tramp}. However, running interactive remote shells might | ||
| 1890 | require a different setting. This could be achieved by tweaking the | ||
| 1891 | @env{TERM} environment variable in @code{process-environment}. | ||
| 1892 | |||
| 1893 | @lisp | ||
| 1894 | @group | ||
| 1895 | (let ((process-environment | ||
| 1896 | (cons "TERM=xterm-256color" process-environment))) | ||
| 1897 | (shell)) | ||
| 1898 | @end group | ||
| 1899 | @end lisp | ||
| 1900 | |||
| 1901 | @item Determining a @value{tramp} session | ||
| 1902 | @vindex TERM@r{, environment variable} | ||
| 1903 | @vindex INSIDE_EMACS@r{, environment variable} | ||
| 1904 | |||
| 1905 | Sometimes, it is needed to identify whether a shell runs under | ||
| 1906 | @value{tramp} control. The setting of environment variable @env{TERM} | ||
| 1907 | will help: | ||
| 1908 | |||
| 1909 | @example | ||
| 1910 | @group | ||
| 1911 | if test "$TERM" = "dumb"; then | ||
| 1912 | ... | ||
| 1913 | fi | ||
| 1914 | @end group | ||
| 1915 | @end example | ||
| 1916 | |||
| 1917 | Another possibility is to check the environment variable | ||
| 1918 | @env{INSIDE_EMACS}. Like for all subprocesses of Emacs, this is set | ||
| 1919 | to the version of the parent Emacs process, @xref{Interactive Shell, , | ||
| 1920 | , emacs}. @value{tramp} adds its own package version to this string, | ||
| 1921 | which could be used for further tests in an inferior shell. The | ||
| 1922 | string of that environment variable loooks always like | ||
| 1923 | |||
| 1924 | @example | ||
| 1925 | @group | ||
| 1926 | echo $INSIDE_EMACS | ||
| 1927 | @result{} 26.2,tramp:2.3.4 | ||
| 1928 | @end group | ||
| 1929 | @end example | ||
| 1930 | |||
| 1880 | @item @command{tset} and other questions | 1931 | @item @command{tset} and other questions |
| 1881 | @cindex unix command @command{tset} | 1932 | @cindex unix command @command{tset} |
| 1882 | @cindex @command{tset} unix command | 1933 | @cindex @command{tset} unix command |
| 1883 | 1934 | ||
| 1884 | @vindex tramp-terminal-type | ||
| 1885 | To suppress inappropriate prompts for terminal type, @value{tramp} | 1935 | To suppress inappropriate prompts for terminal type, @value{tramp} |
| 1886 | sets the @env{TERM} to @code{dumb} before the remote login process | 1936 | sets the @env{TERM} environment variable before the remote login |
| 1887 | begins via the user option @option{tramp-terminal-type}. This will | 1937 | process begins via the user option @option{tramp-terminal-type} (see |
| 1888 | silence common @command{tset} related prompts. | 1938 | above). This will silence common @command{tset} related prompts. |
| 1889 | 1939 | ||
| 1890 | @value{tramp}'s strategy for handling such prompts (commonly triggered | 1940 | @value{tramp}'s strategy for handling such prompts (commonly triggered |
| 1891 | from login scripts on remote hosts) is to set the environment | 1941 | from login scripts on remote hosts) is to set the environment |
| @@ -1958,6 +2008,9 @@ shell-specific config files. For example, bash can use | |||
| 1958 | 2008 | ||
| 1959 | @item Interactive shell prompt | 2009 | @item Interactive shell prompt |
| 1960 | 2010 | ||
| 2011 | @vindex INSIDE_EMACS@r{, environment variable} | ||
| 2012 | @vindex SHELLNAME@r{, environment variable} | ||
| 2013 | @vindex ESHELL@r{, environment variable} | ||
| 1961 | @value{tramp} redefines the remote shell prompt internally for robust | 2014 | @value{tramp} redefines the remote shell prompt internally for robust |
| 1962 | parsing. This redefinition affects the looks of a prompt in an | 2015 | parsing. This redefinition affects the looks of a prompt in an |
| 1963 | interactive remote shell through commands, such as @kbd{M-x shell | 2016 | interactive remote shell through commands, such as @kbd{M-x shell |
| @@ -2248,6 +2301,7 @@ Windows file names to Cygwin file names. | |||
| 2248 | 2301 | ||
| 2249 | @cindex cygwin and @command{ssh-agent} | 2302 | @cindex cygwin and @command{ssh-agent} |
| 2250 | @cindex @env{SSH_AUTH_SOCK} and emacs on ms windows | 2303 | @cindex @env{SSH_AUTH_SOCK} and emacs on ms windows |
| 2304 | @vindex SSH_AUTH_SOCK@r{, environment variable} | ||
| 2251 | 2305 | ||
| 2252 | When using the @command{ssh-agent} on MS Windows for password-less | 2306 | When using the @command{ssh-agent} on MS Windows for password-less |
| 2253 | interaction, @option{ssh} methods depend on the environment variable | 2307 | interaction, @option{ssh} methods depend on the environment variable |
| @@ -2620,6 +2674,7 @@ Use @code{add-to-list} to add entries: | |||
| 2620 | (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") | 2674 | (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") |
| 2621 | @end lisp | 2675 | @end lisp |
| 2622 | 2676 | ||
| 2677 | @vindex HISTORY@r{, environment variable} | ||
| 2623 | Modifying or deleting already existing values in the | 2678 | Modifying or deleting already existing values in the |
| 2624 | @option{tramp-remote-process-environment} list may not be feasible on | 2679 | @option{tramp-remote-process-environment} list may not be feasible on |
| 2625 | restricted remote hosts. For example, some system administrators | 2680 | restricted remote hosts. For example, some system administrators |
| @@ -2636,6 +2691,7 @@ local @file{.emacs} file: | |||
| 2636 | @end group | 2691 | @end group |
| 2637 | @end lisp | 2692 | @end lisp |
| 2638 | 2693 | ||
| 2694 | @vindex ENV@r{, environment variable} | ||
| 2639 | Setting the @env{ENV} environment variable instructs some shells to | 2695 | Setting the @env{ENV} environment variable instructs some shells to |
| 2640 | read an initialization file. Per default, @value{tramp} has disabled | 2696 | read an initialization file. Per default, @value{tramp} has disabled |
| 2641 | this. You could overwrite this behavior by evaluating | 2697 | this. You could overwrite this behavior by evaluating |
| @@ -2663,6 +2719,7 @@ For example: | |||
| 2663 | @end group | 2719 | @end group |
| 2664 | @end lisp | 2720 | @end lisp |
| 2665 | 2721 | ||
| 2722 | @vindex HGPLAIN@r{, environment variable} | ||
| 2666 | Let-binding in this way works regardless of whether the process to be | 2723 | Let-binding in this way works regardless of whether the process to be |
| 2667 | called is local or remote, since @value{tramp} would add just the | 2724 | called is local or remote, since @value{tramp} would add just the |
| 2668 | @env{HGPLAIN} setting and local processes would take whole value of | 2725 | @env{HGPLAIN} setting and local processes would take whole value of |
| @@ -2674,6 +2731,7 @@ remotely, please file a bug report. @xref{Bug Reports}. | |||
| 2674 | 2731 | ||
| 2675 | @subsection Running remote programs that create local X11 windows | 2732 | @subsection Running remote programs that create local X11 windows |
| 2676 | 2733 | ||
| 2734 | @vindex DISPLAY@r{, environment variable} | ||
| 2677 | To allow a remote program to create an X11 window on the local host, | 2735 | To allow a remote program to create an X11 window on the local host, |
| 2678 | set the @env{DISPLAY} environment variable for the remote host as | 2736 | set the @env{DISPLAY} environment variable for the remote host as |
| 2679 | follows in the local @file{.emacs} file: | 2737 | follows in the local @file{.emacs} file: |
| @@ -3098,7 +3156,7 @@ uses left-hand side and right-hand side prompts in parallel. Add the | |||
| 3098 | following line to @file{~/.zshrc}: | 3156 | following line to @file{~/.zshrc}: |
| 3099 | 3157 | ||
| 3100 | @example | 3158 | @example |
| 3101 | [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' | 3159 | [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return |
| 3102 | @end example | 3160 | @end example |
| 3103 | 3161 | ||
| 3104 | When using fish shell on remote hosts, disable fancy formatting by | 3162 | When using fish shell on remote hosts, disable fancy formatting by |
| @@ -3321,6 +3379,9 @@ then set them with a hook as follows: | |||
| 3321 | Why is @file{~/.sh_history} file on the remote host growing? | 3379 | Why is @file{~/.sh_history} file on the remote host growing? |
| 3322 | 3380 | ||
| 3323 | @vindex tramp-histfile-override | 3381 | @vindex tramp-histfile-override |
| 3382 | @vindex HISTFILE@r{, environment variable} | ||
| 3383 | @vindex HISTFILESIZE@r{, environment variable} | ||
| 3384 | @vindex HISTSIZE@r{, environment variable} | ||
| 3324 | Due to the remote shell saving tilde expansions triggered by | 3385 | Due to the remote shell saving tilde expansions triggered by |
| 3325 | @value{tramp}, the history file is probably growing rapidly. | 3386 | @value{tramp}, the history file is probably growing rapidly. |
| 3326 | @value{tramp} can suppress this behavior with the user option | 3387 | @value{tramp} can suppress this behavior with the user option |
| @@ -3668,6 +3729,7 @@ emacsclient @trampfn{ssh,$(whoami)@@$(hostname --fqdn),$1} | |||
| 3668 | @end group | 3729 | @end group |
| 3669 | @end example | 3730 | @end example |
| 3670 | 3731 | ||
| 3732 | @vindex EDITOR@r{, environment variable} | ||
| 3671 | Then change the environment variable @env{EDITOR} to point to the | 3733 | Then change the environment variable @env{EDITOR} to point to the |
| 3672 | wrapper script: | 3734 | wrapper script: |
| 3673 | 3735 | ||