aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-05-29 12:45:47 +0200
committerMichael Albinus2018-05-29 12:45:47 +0200
commite5b98e02731556f891003d10ab6fc76e6b1c3dcb (patch)
tree2ccfe2aaf31563e7d85ccef9804fdf3db9e216c7
parentb3207538c61c0e5d370df36a35e47c951214055c (diff)
parent13963a3a5c83aff1eacee933361e3ac0f21828cd (diff)
downloademacs-e5b98e02731556f891003d10ab6fc76e6b1c3dcb.tar.gz
emacs-e5b98e02731556f891003d10ab6fc76e6b1c3dcb.zip
Merge from origin/emacs-26
13963a3a5c * doc/misc/tramp.texi (All): Use @code instead of @option ... 6e5f19ada4 Fix Bug#31605
-rw-r--r--doc/misc/tramp.texi180
1 files changed, 121 insertions, 59 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 5dd1a2ca4ee..c34341b9ac9 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -682,7 +682,7 @@ remote host, and then tries that program for encoding and decoding.
682@vindex tramp-inline-compress-start-size 682@vindex tramp-inline-compress-start-size
683To increase transfer speeds for large text files, use compression 683To increase transfer speeds for large text files, use compression
684before encoding. The user option 684before encoding. The user option
685@option{tramp-inline-compress-start-size} specifies the file size for 685@code{tramp-inline-compress-start-size} specifies the file size for
686such optimization. 686such optimization.
687 687
688@table @asis 688@table @asis
@@ -1023,17 +1023,18 @@ can.
1023@cindex android (with @option{adb} method) 1023@cindex android (with @option{adb} method)
1024 1024
1025@vindex tramp-adb-program 1025@vindex tramp-adb-program
1026@vindex PATH@r{, environment variable}
1026This method uses Android Debug Bridge program for accessing Android 1027This method uses Android Debug Bridge program for accessing Android
1027devices. The Android Debug Bridge must be installed locally for 1028devices. The Android Debug Bridge must be installed locally for
1028@value{tramp} to work. Some GNU/Linux distributions provide Android 1029@value{tramp} to work. Some GNU/Linux distributions provide Android
1029Debug Bridge as an installation package. Alternatively, the program 1030Debug Bridge as an installation package. Alternatively, the program
1030is installed as part of the Android SDK@. @value{tramp} finds the 1031is installed as part of the Android SDK@. @value{tramp} finds the
1031@command{adb} program either via the @env{PATH} environment variable 1032@command{adb} program either via the @env{PATH} environment variable
1032or the absolute path set in the user option @option{tramp-adb-program}. 1033or the absolute path set in the user option @code{tramp-adb-program}.
1033 1034
1034@vindex tramp-adb-connect-if-not-connected 1035@vindex tramp-adb-connect-if-not-connected
1035@value{tramp} connects to Android devices with @option{adb} only when 1036@value{tramp} connects to Android devices with @option{adb} only when
1036the user option @option{tramp-adb-connect-if-not-connected} is not 1037the user option @code{tramp-adb-connect-if-not-connected} is not
1037@code{nil}. Otherwise, the connection must be established outside 1038@code{nil}. Otherwise, the connection must be established outside
1038Emacs. 1039Emacs.
1039 1040
@@ -1166,7 +1167,7 @@ pseudo method @option{-}, @ref{File name syntax}.
1166 1167
1167@defopt tramp-default-method 1168@defopt tramp-default-method
1168Default method is for transferring files. The user option 1169Default method is for transferring files. The user option
1169@option{tramp-default-method} sets it. @value{tramp} uses this user 1170@code{tramp-default-method} sets it. @value{tramp} uses this user
1170option to determine the default method for remote file names that do 1171option to determine the default method for remote file names that do
1171not have one specified. 1172not have one specified.
1172 1173
@@ -1178,7 +1179,7 @@ not have one specified.
1178@defopt tramp-default-method-alist 1179@defopt tramp-default-method-alist
1179Default methods for transferring files can be customized for specific 1180Default methods for transferring files can be customized for specific
1180user and host combinations through the user option 1181user and host combinations through the user option
1181@option{tramp-default-method-alist}. 1182@code{tramp-default-method-alist}.
1182 1183
1183For example, the following two lines specify to use the @option{ssh} 1184For example, the following two lines specify to use the @option{ssh}
1184method for all user names matching @samp{john} and the @option{rsync} 1185method for all user names matching @samp{john} and the @option{rsync}
@@ -1254,7 +1255,7 @@ improvement is not always true.
1254@defopt tramp-default-user 1255@defopt tramp-default-user
1255@value{tramp} file name can omit the user name part since 1256@value{tramp} file name can omit the user name part since
1256@value{tramp} substitutes the currently logged-in user name. However 1257@value{tramp} substitutes the currently logged-in user name. However
1257this substitution can be overridden with @option{tramp-default-user}. 1258this substitution can be overridden with @code{tramp-default-user}.
1258For example: 1259For example:
1259 1260
1260@lisp 1261@lisp
@@ -1263,7 +1264,7 @@ For example:
1263@end defopt 1264@end defopt
1264 1265
1265@defopt tramp-default-user-alist 1266@defopt tramp-default-user-alist
1266Instead of a single default user, @option{tramp-default-user-alist} 1267Instead of a single default user, @code{tramp-default-user-alist}
1267allows multiple default user values based on access method or host 1268allows multiple default user values based on access method or host
1268name combinations. The alist can hold multiple values. For example, to 1269name combinations. The alist can hold multiple values. For example, to
1269use the @samp{john} as the default user for the domain 1270use the @samp{john} as the default user for the domain
@@ -1288,7 +1289,7 @@ corresponding alist entry to nil:
1288@end group 1289@end group
1289@end lisp 1290@end lisp
1290 1291
1291The last entry in @option{tramp-default-user-alist} should be reserved 1292The last entry in @code{tramp-default-user-alist} should be reserved
1292for catch-all or most often used login. 1293for catch-all or most often used login.
1293 1294
1294@lisp 1295@lisp
@@ -1306,7 +1307,7 @@ for catch-all or most often used login.
1306 1307
1307@defopt tramp-default-host 1308@defopt tramp-default-host
1308When host name is omitted, @value{tramp} substitutes the value from 1309When host name is omitted, @value{tramp} substitutes the value from
1309the @option{tramp-default-host} user option. It is initially 1310the @code{tramp-default-host} user option. It is initially
1310populated with the local host name where Emacs is running. The 1311populated with the local host name where Emacs is running. The
1311default method, default user and default host can be overridden as 1312default method, default user and default host can be overridden as
1312follows: 1313follows:
@@ -1325,10 +1326,10 @@ to John's home directory on @code{target} via @code{ssh}.
1325@end defopt 1326@end defopt
1326 1327
1327@defopt tramp-default-host-alist 1328@defopt tramp-default-host-alist
1328Instead of a single default host, @option{tramp-default-host-alist} 1329Instead of a single default host, @code{tramp-default-host-alist}
1329allows multiple default host values based on access method or user 1330allows multiple default host values based on access method or user
1330name combinations. The alist can hold multiple values. While 1331name combinations. The alist can hold multiple values. While
1331@option{tramp-default-host} is sufficient in most cases, some methods, 1332@code{tramp-default-host} is sufficient in most cases, some methods,
1332like @option{adb}, require defaults overwritten. 1333like @option{adb}, require defaults overwritten.
1333@end defopt 1334@end defopt
1334 1335
@@ -1346,7 +1347,7 @@ hop kind, where the start and end points of the connection did not
1346have intermediate check points. 1347have intermediate check points.
1347 1348
1348@defopt tramp-default-proxies-alist 1349@defopt tramp-default-proxies-alist
1349@option{tramp-default-proxies-alist} specifies proxy hosts to pass 1350@code{tramp-default-proxies-alist} specifies proxy hosts to pass
1350through. This user option is list of triples consisting of 1351through. This user option is list of triples consisting of
1351@code{(@var{host} @var{user} @var{proxy})}. 1352@code{(@var{host} @var{user} @var{proxy})}.
1352 1353
@@ -1709,16 +1710,16 @@ Set @code{password-cache} to @code{nil} to disable password caching.
1709@vindex tramp-persistency-file-name 1710@vindex tramp-persistency-file-name
1710For faster initial connection times, @value{tramp} stores previous 1711For faster initial connection times, @value{tramp} stores previous
1711connection properties in a file specified by the user option 1712connection properties in a file specified by the user option
1712@option{tramp-persistency-file-name}. 1713@code{tramp-persistency-file-name}.
1713 1714
1714The default file name for @option{tramp-persistency-file-name} is 1715The default file name for @code{tramp-persistency-file-name} is
1715@file{~/.emacs.d/tramp}. 1716@file{~/.emacs.d/tramp}.
1716 1717
1717@value{tramp} reads this file during Emacs startup, and writes to it 1718@value{tramp} reads this file during Emacs startup, and writes to it
1718when exiting Emacs. Delete this file for @value{tramp} to recreate a 1719when exiting Emacs. Delete this file for @value{tramp} to recreate a
1719new one on next Emacs startup. 1720new one on next Emacs startup.
1720 1721
1721Set @option{tramp-persistency-file-name} to @code{nil} to disable 1722Set @code{tramp-persistency-file-name} to @code{nil} to disable
1722storing connections persistently. 1723storing connections persistently.
1723 1724
1724When @value{tramp} detects a change in the operating system version in 1725When @value{tramp} detects a change in the operating system version in
@@ -1733,7 +1734,7 @@ For more precise customization, parameters specified by
1733@code{tramp-methods} can be overwritten manually. 1734@code{tramp-methods} can be overwritten manually.
1734 1735
1735@vindex tramp-connection-properties 1736@vindex tramp-connection-properties
1736Set @option{tramp-connection-properties} to manually override 1737Set @code{tramp-connection-properties} to manually override
1737@code{tramp-methods}. Properties in this list are in the form 1738@code{tramp-methods}. Properties in this list are in the form
1738@code{(@var{regexp} @var{property} @var{value})}. @var{regexp} 1739@code{(@var{regexp} @var{property} @var{value})}. @var{regexp}
1739matches remote file names. Use @code{nil} to match all. 1740matches remote file names. Use @code{nil} to match all.
@@ -1765,7 +1766,7 @@ The parameters @code{tramp-remote-shell} and
1765values for the remote host. 1766values for the remote host.
1766 1767
1767@var{property} could also be any property found in 1768@var{property} could also be any property found in
1768@option{tramp-persistency-file-name}. 1769@code{tramp-persistency-file-name}.
1769 1770
1770To get around how restricted shells randomly drop connections, set the 1771To get around how restricted shells randomly drop connections, set the
1771special property @samp{busybox}. For example: 1772special property @samp{busybox}. For example:
@@ -1794,7 +1795,7 @@ To improve performance and accuracy of remote file access,
1794@command{grep} when available. 1795@command{grep} when available.
1795 1796
1796@defopt tramp-remote-path 1797@defopt tramp-remote-path
1797@option{tramp-remote-path} specifies which remote directory paths 1798@code{tramp-remote-path} specifies which remote directory paths
1798@value{tramp} can search for @ref{Remote programs}. 1799@value{tramp} can search for @ref{Remote programs}.
1799 1800
1800@vindex tramp-default-remote-path 1801@vindex tramp-default-remote-path
@@ -1819,7 +1820,7 @@ Another way to find the remote path is to use the path assigned to the
1819remote user by the remote host. @value{tramp} does not normally retain 1820remote user by the remote host. @value{tramp} does not normally retain
1820this remote path after login. However, @code{tramp-own-remote-path} 1821this remote path after login. However, @code{tramp-own-remote-path}
1821preserves the path value, which can be used to update 1822preserves the path value, which can be used to update
1822@option{tramp-remote-path}. 1823@code{tramp-remote-path}.
1823 1824
1824@lisp 1825@lisp
1825(add-to-list 'tramp-remote-path 'tramp-own-remote-path) 1826(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
@@ -1863,22 +1864,22 @@ login security, especially not the exotic ones. However, @value{tramp}
1863provides a few tweaks to address the most common ones. 1864provides a few tweaks to address the most common ones.
1864 1865
1865@table @asis 1866@table @asis
1866@item @option{tramp-shell-prompt-pattern} 1867@item @code{tramp-shell-prompt-pattern}
1867@vindex tramp-shell-prompt-pattern 1868@vindex tramp-shell-prompt-pattern
1868 1869
1869@option{tramp-shell-prompt-pattern} is for remote login shell prompt, 1870@code{tramp-shell-prompt-pattern} is for remote login shell prompt,
1870which may not be the same as the local login shell prompt, 1871which may not be the same as the local login shell prompt,
1871@code{shell-prompt-pattern}. Since most hosts use identical prompts, 1872@code{shell-prompt-pattern}. Since most hosts use identical prompts,
1872@value{tramp} sets a similar default value for both prompts. 1873@value{tramp} sets a similar default value for both prompts.
1873 1874
1874@item @option{tramp-password-prompt-regexp} 1875@item @code{tramp-password-prompt-regexp}
1875@item @option{tramp-wrong-passwd-regexp} 1876@item @code{tramp-wrong-passwd-regexp}
1876@vindex tramp-password-prompt-regexp 1877@vindex tramp-password-prompt-regexp
1877@vindex tramp-wrong-passwd-regexp 1878@vindex tramp-wrong-passwd-regexp
1878 1879
1879@value{tramp} uses @option{tramp-password-prompt-regexp} to 1880@value{tramp} uses @code{tramp-password-prompt-regexp} to
1880distinguish between prompts for passwords and prompts for passphrases. 1881distinguish between prompts for passwords and prompts for passphrases.
1881By default, @option{tramp-password-prompt-regexp} handles the 1882By default, @code{tramp-password-prompt-regexp} handles the
1882detection in English language environments. See a localization 1883detection in English language environments. See a localization
1883example below: 1884example below:
1884 1885
@@ -1902,17 +1903,66 @@ example below:
1902@end lisp 1903@end lisp
1903 1904
1904Similar localization may be necessary for handling wrong password 1905Similar localization may be necessary for handling wrong password
1905prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}. 1906prompts, for which @value{tramp} uses @code{tramp-wrong-passwd-regexp}.
1907
1908@item @code{tramp-terminal-type}
1909@vindex tramp-terminal-type
1910@vindex TERM@r{, environment variable}
1911
1912@value{tramp} uses the user option @code{tramp-terminal-type} to set
1913the remote environment variable @env{TERM} for the shells it runs.
1914Per default, it is @samp{"dumb"}, but this could be changed. A dumb
1915terminal is best suited to run the background sessions of
1916@value{tramp}. However, running interactive remote shells might
1917require a different setting. This could be achieved by tweaking the
1918@env{TERM} environment variable in @code{process-environment}.
1919
1920@lisp
1921@group
1922(let ((process-environment
1923 (cons "TERM=xterm-256color" process-environment)))
1924 (shell))
1925@end group
1926@end lisp
1927
1928@item Determining a @value{tramp} session
1929@vindex TERM@r{, environment variable}
1930@vindex INSIDE_EMACS@r{, environment variable}
1931
1932Sometimes, it is needed to identify whether a shell runs under
1933@value{tramp} control. The setting of environment variable @env{TERM}
1934will help:
1935
1936@example
1937@group
1938if test "$TERM" = "dumb"; then
1939 ...
1940fi
1941@end group
1942@end example
1943
1944Another possibility is to check the environment variable
1945@env{INSIDE_EMACS}. Like for all subprocesses of Emacs, this is set
1946to the version of the parent Emacs process, @xref{Interactive Shell, ,
1947, emacs}. @value{tramp} adds its own package version to this string,
1948which could be used for further tests in an inferior shell. The
1949string of that environment variable loooks always like
1950
1951@example
1952@group
1953echo $INSIDE_EMACS
1954@result{} 26.2,tramp:2.3.4
1955@end group
1956@end example
1906 1957
1907@item @command{tset} and other questions 1958@item @command{tset} and other questions
1908@cindex unix command @command{tset} 1959@cindex unix command @command{tset}
1909@cindex @command{tset} unix command 1960@cindex @command{tset} unix command
1910 1961
1911@vindex tramp-terminal-type
1912To suppress inappropriate prompts for terminal type, @value{tramp} 1962To suppress inappropriate prompts for terminal type, @value{tramp}
1913sets the @env{TERM} to @code{dumb} before the remote login process 1963sets the @env{TERM} environment variable before the remote login
1914begins via the user option @option{tramp-terminal-type}. This will 1964process begins via the user option @code{tramp-terminal-type} (see
1915silence common @command{tset} related prompts. 1965above). This will silence common @command{tset} related prompts.
1916 1966
1917@value{tramp}'s strategy for handling such prompts (commonly triggered 1967@value{tramp}'s strategy for handling such prompts (commonly triggered
1918from login scripts on remote hosts) is to set the environment 1968from login scripts on remote hosts) is to set the environment
@@ -1985,6 +2035,9 @@ shell-specific config files. For example, bash can use
1985 2035
1986@item Interactive shell prompt 2036@item Interactive shell prompt
1987 2037
2038@vindex INSIDE_EMACS@r{, environment variable}
2039@vindex SHELLNAME@r{, environment variable}
2040@vindex ESHELL@r{, environment variable}
1988@value{tramp} redefines the remote shell prompt internally for robust 2041@value{tramp} redefines the remote shell prompt internally for robust
1989parsing. This redefinition affects the looks of a prompt in an 2042parsing. This redefinition affects the looks of a prompt in an
1990interactive remote shell through commands, such as @kbd{M-x shell 2043interactive remote shell through commands, such as @kbd{M-x shell
@@ -2142,7 +2195,7 @@ Open a remote connection with a more concise command @kbd{C-x C-f
2142@vindex backup-directory-alist 2195@vindex backup-directory-alist
2143To avoid @value{tramp} from saving backup files owned by @samp{root} 2196To avoid @value{tramp} from saving backup files owned by @samp{root}
2144to locations accessible to others, default backup settings in 2197to locations accessible to others, default backup settings in
2145@option{backup-directory-alist} have to be altered. 2198@code{backup-directory-alist} have to be altered.
2146 2199
2147Here's a scenario where files could be inadvertently exposed. Emacs 2200Here's a scenario where files could be inadvertently exposed. Emacs
2148by default writes backup files to the same directory as the original 2201by default writes backup files to the same directory as the original
@@ -2153,7 +2206,7 @@ default by @value{tramp} when using, say, a restricted file
2153of the secretfile is now owned by the user logged in from 2206of the secretfile is now owned by the user logged in from
2154@value{tramp} and not @samp{root}. 2207@value{tramp} and not @samp{root}.
2155 2208
2156When @option{backup-directory-alist} is @code{nil} (the default), such 2209When @code{backup-directory-alist} is @code{nil} (the default), such
2157problems do not occur. 2210problems do not occur.
2158 2211
2159To ``turn off'' the backup feature for @value{tramp} files and stop 2212To ``turn off'' the backup feature for @value{tramp} files and stop
@@ -2187,8 +2240,8 @@ Another option is to create better backup file naming with user and
2187host names prefixed to the file name. For example, transforming 2240host names prefixed to the file name. For example, transforming
2188@file{/etc/secretfile} to 2241@file{/etc/secretfile} to
2189@file{~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile}, set the 2242@file{~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile}, set the
2190@value{tramp} user option @option{tramp-backup-directory-alist} from 2243@value{tramp} user option @code{tramp-backup-directory-alist} from
2191the existing user option @option{backup-directory-alist}. 2244the existing user option @code{backup-directory-alist}.
2192 2245
2193Then @value{tramp} backs up to a file name that is transformed with a 2246Then @value{tramp} backs up to a file name that is transformed with a
2194prefix consisting of the DIRECTORY name. This file name prefixing 2247prefix consisting of the DIRECTORY name. This file name prefixing
@@ -2220,16 +2273,16 @@ The backup file name of
2220Just as for backup files, similar issues of file naming affect 2273Just as for backup files, similar issues of file naming affect
2221auto-saving @value{tramp} files. Auto-saved files are saved in the 2274auto-saving @value{tramp} files. Auto-saved files are saved in the
2222directory specified by the user option 2275directory specified by the user option
2223@option{auto-save-file-name-transforms}. By default this is set to 2276@code{auto-save-file-name-transforms}. By default this is set to
2224the local temporary directory. But in some versions of Debian 2277the local temporary directory. But in some versions of Debian
2225GNU/Linux, this points to the source directory where the Emacs was 2278GNU/Linux, this points to the source directory where the Emacs was
2226compiled. Reset such values to a valid directory. 2279compiled. Reset such values to a valid directory.
2227 2280
2228Set @option{auto-save-file-name-transforms} to @code{nil} to save 2281Set @code{auto-save-file-name-transforms} to @code{nil} to save
2229auto-saved files to the same directory as the original file. 2282auto-saved files to the same directory as the original file.
2230 2283
2231@vindex tramp-auto-save-directory 2284@vindex tramp-auto-save-directory
2232Alternatively, set the user option @option{tramp-auto-save-directory} 2285Alternatively, set the user option @code{tramp-auto-save-directory}
2233to direct all auto saves to that location. 2286to direct all auto saves to that location.
2234 2287
2235@node Windows setup hints 2288@node Windows setup hints
@@ -2275,6 +2328,7 @@ Windows file names to Cygwin file names.
2275 2328
2276@cindex cygwin and @command{ssh-agent} 2329@cindex cygwin and @command{ssh-agent}
2277@cindex @env{SSH_AUTH_SOCK} and emacs on ms windows 2330@cindex @env{SSH_AUTH_SOCK} and emacs on ms windows
2331@vindex SSH_AUTH_SOCK@r{, environment variable}
2278 2332
2279When using the @command{ssh-agent} on MS Windows for password-less 2333When using the @command{ssh-agent} on MS Windows for password-less
2280interaction, @option{ssh} methods depend on the environment variable 2334interaction, @option{ssh} methods depend on the environment variable
@@ -2551,7 +2605,7 @@ directory contents.
2551@cindex proxy hosts, ad-hoc 2605@cindex proxy hosts, ad-hoc
2552 2606
2553@value{tramp} file name syntax can accommodate ad hoc specification of 2607@value{tramp} file name syntax can accommodate ad hoc specification of
2554multiple proxies without using @option{tramp-default-proxies-alist} 2608multiple proxies without using @code{tramp-default-proxies-alist}
2555configuration setup(@pxref{Multi-hops}). 2609configuration setup(@pxref{Multi-hops}).
2556 2610
2557Each proxy is specified using the same syntax as the remote host 2611Each proxy is specified using the same syntax as the remote host
@@ -2568,15 +2622,15 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}:
2568Proxies can take patterns @code{%h} or @code{%u}. 2622Proxies can take patterns @code{%h} or @code{%u}.
2569 2623
2570@value{tramp} adds the ad-hoc definitions on the fly to 2624@value{tramp} adds the ad-hoc definitions on the fly to
2571@option{tramp-default-proxies-alist} and is available for re-use 2625@code{tramp-default-proxies-alist} and is available for re-use
2572during that Emacs session. Subsequent @value{tramp} connections to 2626during that Emacs session. Subsequent @value{tramp} connections to
2573the same remote host can then use the shortcut form: 2627the same remote host can then use the shortcut form:
2574@samp{@trampfn{ssh,you@@remotehost,/path}}. 2628@samp{@trampfn{ssh,you@@remotehost,/path}}.
2575 2629
2576@defopt tramp-save-ad-hoc-proxies 2630@defopt tramp-save-ad-hoc-proxies
2577For ad-hoc definitions to be saved automatically in 2631For ad-hoc definitions to be saved automatically in
2578@option{tramp-default-proxies-alist} for future Emacs sessions, set 2632@code{tramp-default-proxies-alist} for future Emacs sessions, set
2579@option{tramp-save-ad-hoc-proxies} to non-@code{nil}. 2633@code{tramp-save-ad-hoc-proxies} to non-@code{nil}.
2580 2634
2581@lisp 2635@lisp
2582(customize-set-variable 'tramp-save-ad-hoc-proxies t) 2636(customize-set-variable 'tramp-save-ad-hoc-proxies t)
@@ -2621,7 +2675,7 @@ like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or
2621For @value{tramp} to find the command on the remote, it must be 2675For @value{tramp} to find the command on the remote, it must be
2622accessible through the default search path as setup by @value{tramp} 2676accessible through the default search path as setup by @value{tramp}
2623upon first connection. Alternatively, use an absolute path or extend 2677upon first connection. Alternatively, use an absolute path or extend
2624@option{tramp-remote-path} (see @ref{Remote programs}): 2678@code{tramp-remote-path} (see @ref{Remote programs}):
2625 2679
2626@lisp 2680@lisp
2627@group 2681@group
@@ -2631,9 +2685,9 @@ upon first connection. Alternatively, use an absolute path or extend
2631@end lisp 2685@end lisp
2632 2686
2633@vindex tramp-remote-process-environment 2687@vindex tramp-remote-process-environment
2634Customize user option @option{tramp-remote-process-environment} to 2688Customize user option @code{tramp-remote-process-environment} to
2635suit the remote program's environment for the remote host. 2689suit the remote program's environment for the remote host.
2636@option{tramp-remote-process-environment} is a list of strings 2690@code{tramp-remote-process-environment} is a list of strings
2637structured similar to @code{process-environment}, where each element 2691structured similar to @code{process-environment}, where each element
2638is a string of the form @samp{ENVVARNAME=VALUE}. 2692is a string of the form @samp{ENVVARNAME=VALUE}.
2639 2693
@@ -2648,12 +2702,13 @@ Use @code{add-to-list} to add entries:
2648(add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") 2702(add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java")
2649@end lisp 2703@end lisp
2650 2704
2705@vindex HISTORY@r{, environment variable}
2651Modifying or deleting already existing values in the 2706Modifying or deleting already existing values in the
2652@option{tramp-remote-process-environment} list may not be feasible on 2707@code{tramp-remote-process-environment} list may not be feasible on
2653restricted remote hosts. For example, some system administrators 2708restricted remote hosts. For example, some system administrators
2654disallow changing @env{HISTORY} environment variable. To accommodate 2709disallow changing @env{HISTORY} environment variable. To accommodate
2655such restrictions when using @value{tramp}, fix the 2710such restrictions when using @value{tramp}, fix the
2656@option{tramp-remote-process-environment} by the following code in the 2711@code{tramp-remote-process-environment} by the following code in the
2657local @file{.emacs} file: 2712local @file{.emacs} file:
2658 2713
2659@lisp 2714@lisp
@@ -2664,6 +2719,7 @@ local @file{.emacs} file:
2664@end group 2719@end group
2665@end lisp 2720@end lisp
2666 2721
2722@vindex ENV@r{, environment variable}
2667Setting the @env{ENV} environment variable instructs some shells to 2723Setting the @env{ENV} environment variable instructs some shells to
2668read an initialization file. Per default, @value{tramp} has disabled 2724read an initialization file. Per default, @value{tramp} has disabled
2669this. You could overwrite this behavior by evaluating 2725this. You could overwrite this behavior by evaluating
@@ -2676,12 +2732,12 @@ this. You could overwrite this behavior by evaluating
2676@end group 2732@end group
2677@end lisp 2733@end lisp
2678 2734
2679In addition to @option{tramp-remote-process-environment}, you can set 2735In addition to @code{tramp-remote-process-environment}, you can set
2680environment variables for individual remote process calls by 2736environment variables for individual remote process calls by
2681let-binding @code{process-environment}. @value{tramp} applies any 2737let-binding @code{process-environment}. @value{tramp} applies any
2682entries not present in the global default value of 2738entries not present in the global default value of
2683@code{process-environment} (overriding 2739@code{process-environment} (overriding
2684@option{tramp-remote-process-environment} settings, if they conflict). 2740@code{tramp-remote-process-environment} settings, if they conflict).
2685For example: 2741For example:
2686 2742
2687@lisp 2743@lisp
@@ -2691,6 +2747,7 @@ For example:
2691@end group 2747@end group
2692@end lisp 2748@end lisp
2693 2749
2750@vindex HGPLAIN@r{, environment variable}
2694Let-binding in this way works regardless of whether the process to be 2751Let-binding in this way works regardless of whether the process to be
2695called is local or remote, since @value{tramp} would add just the 2752called is local or remote, since @value{tramp} would add just the
2696@env{HGPLAIN} setting and local processes would take whole value of 2753@env{HGPLAIN} setting and local processes would take whole value of
@@ -2702,6 +2759,7 @@ remotely, please file a bug report. @xref{Bug Reports}.
2702 2759
2703@subsection Running remote programs that create local X11 windows 2760@subsection Running remote programs that create local X11 windows
2704 2761
2762@vindex DISPLAY@r{, environment variable}
2705To allow a remote program to create an X11 window on the local host, 2763To allow a remote program to create an X11 window on the local host,
2706set the @env{DISPLAY} environment variable for the remote host as 2764set the @env{DISPLAY} environment variable for the remote host as
2707follows in the local @file{.emacs} file: 2765follows in the local @file{.emacs} file:
@@ -2729,16 +2787,16 @@ local host.
2729@subsection Running @code{shell} on a remote host 2787@subsection Running @code{shell} on a remote host
2730@cindex @code{shell} 2788@cindex @code{shell}
2731 2789
2732Set @option{explicit-shell-file-name} to the appropriate shell name 2790Set @code{explicit-shell-file-name} to the appropriate shell name
2733when using @value{tramp} between two hosts with different operating 2791when using @value{tramp} between two hosts with different operating
2734systems, such as @samp{windows-nt} and @samp{gnu/linux}. This option 2792systems, such as @samp{windows-nt} and @samp{gnu/linux}. This option
2735ensures the correct name of the remote shell program. 2793ensures the correct name of the remote shell program.
2736 2794
2737When @option{explicit-shell-file-name} is equal to @code{nil}, calling 2795When @code{explicit-shell-file-name} is equal to @code{nil}, calling
2738@code{shell} interactively will prompt for a shell name. 2796@code{shell} interactively will prompt for a shell name.
2739 2797
2740Starting with Emacs 26, you could use connection-local variables for 2798Starting with Emacs 26, you could use connection-local variables for
2741setting different values of @option{explicit-shell-file-name} for 2799setting different values of @code{explicit-shell-file-name} for
2742different remote hosts. 2800different remote hosts.
2743@ifinfo 2801@ifinfo
2744@pxref{Connection Local Variables, , , elisp} 2802@pxref{Connection Local Variables, , , elisp}
@@ -2819,7 +2877,7 @@ uid=0(root) gid=0(root) groups=0(root)
2819 2877
2820@code{eshell} added custom @code{su} and @code{sudo} commands that set 2878@code{eshell} added custom @code{su} and @code{sudo} commands that set
2821the default directory correctly for the @file{*eshell*} buffer. 2879the default directory correctly for the @file{*eshell*} buffer.
2822@value{tramp} silently updates @option{tramp-default-proxies-alist} 2880@value{tramp} silently updates @code{tramp-default-proxies-alist}
2823with an entry for this directory (@pxref{Multi-hops}): 2881with an entry for this directory (@pxref{Multi-hops}):
2824 2882
2825@example 2883@example
@@ -2902,7 +2960,7 @@ relative or absolute paths, but not remote paths.
2902command. Powershell V2.0 on the remote host is required to run 2960command. Powershell V2.0 on the remote host is required to run
2903processes triggered from @value{tramp}. 2961processes triggered from @value{tramp}.
2904 2962
2905@option{explicit-shell-file-name} and @option{explicit-*-args} have to 2963@code{explicit-shell-file-name} and @code{explicit-*-args} have to
2906be set properly so @kbd{M-x shell @key{RET}} can open a proper remote 2964be set properly so @kbd{M-x shell @key{RET}} can open a proper remote
2907shell on a MS Windows host. To open @command{cmd}, set it as follows: 2965shell on a MS Windows host. To open @command{cmd}, set it as follows:
2908 2966
@@ -3297,7 +3355,7 @@ responsiveness slows down. Some suggestions within the scope of
3297Use an external method, such as @option{scp}, which are faster than 3355Use an external method, such as @option{scp}, which are faster than
3298internal methods. 3356internal methods.
3299 3357
3300Keep the file @option{tramp-persistency-file-name}, which is where 3358Keep the file @code{tramp-persistency-file-name}, which is where
3301@value{tramp} caches remote information about hosts and files. Caching 3359@value{tramp} caches remote information about hosts and files. Caching
3302is enabled by default. Don't disable it. 3360is enabled by default. Don't disable it.
3303 3361
@@ -3307,7 +3365,7 @@ files are not independently updated outside @value{tramp}'s control.
3307That cache cleanup will be necessary if the remote directories or 3365That cache cleanup will be necessary if the remote directories or
3308files are updated independent of @value{tramp}. 3366files are updated independent of @value{tramp}.
3309 3367
3310Set @option{tramp-completion-reread-directory-timeout} to @code{nil} to 3368Set @code{tramp-completion-reread-directory-timeout} to @code{nil} to
3311speed up completions, @ref{File name completion}. 3369speed up completions, @ref{File name completion}.
3312 3370
3313Disable version control to avoid delays: 3371Disable version control to avoid delays:
@@ -3364,7 +3422,7 @@ uses left-hand side and right-hand side prompts in parallel. Add the
3364following line to @file{~/.zshrc}: 3422following line to @file{~/.zshrc}:
3365 3423
3366@example 3424@example
3367[ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' 3425[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
3368@end example 3426@end example
3369 3427
3370When using fish shell on remote hosts, disable fancy formatting by 3428When using fish shell on remote hosts, disable fancy formatting by
@@ -3572,7 +3630,7 @@ Host indication in the mode line?
3572Install @file{tramp-theme} from GNU ELPA via Emacs' Package Manager. 3630Install @file{tramp-theme} from GNU ELPA via Emacs' Package Manager.
3573Enable it via @kbd{M-x load-theme @key{RET} tramp @key{RET}}. Further 3631Enable it via @kbd{M-x load-theme @key{RET} tramp @key{RET}}. Further
3574customization is explained in user option 3632customization is explained in user option
3575@option{tramp-theme-face-remapping-alist}. 3633@code{tramp-theme-face-remapping-alist}.
3576 3634
3577 3635
3578@item 3636@item
@@ -3597,10 +3655,13 @@ then set them with a hook as follows:
3597Why is @file{~/.sh_history} file on the remote host growing? 3655Why is @file{~/.sh_history} file on the remote host growing?
3598 3656
3599@vindex tramp-histfile-override 3657@vindex tramp-histfile-override
3658@vindex HISTFILE@r{, environment variable}
3659@vindex HISTFILESIZE@r{, environment variable}
3660@vindex HISTSIZE@r{, environment variable}
3600Due to the remote shell saving tilde expansions triggered by 3661Due to the remote shell saving tilde expansions triggered by
3601@value{tramp}, the history file is probably growing rapidly. 3662@value{tramp}, the history file is probably growing rapidly.
3602@value{tramp} can suppress this behavior with the user option 3663@value{tramp} can suppress this behavior with the user option
3603@option{tramp-histfile-override}. When set to @code{t}, environment 3664@code{tramp-histfile-override}. When set to @code{t}, environment
3604variable @env{HISTFILE} is unset, and environment variables 3665variable @env{HISTFILE} is unset, and environment variables
3605@env{HISTFILESIZE} @env{HISTSIZE} are set to 0. 3666@env{HISTFILESIZE} @env{HISTSIZE} are set to 0.
3606 3667
@@ -3896,7 +3957,7 @@ package, use the full ad-hoc file name including all hops, like
3896 3957
3897Alternatively, when saving abbreviated multi-hop file names 3958Alternatively, when saving abbreviated multi-hop file names
3898@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, the user 3959@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, the user
3899option @option{tramp-save-ad-hoc-proxies} must be set non-@code{nil} 3960option @code{tramp-save-ad-hoc-proxies} must be set non-@code{nil}
3900value. 3961value.
3901 3962
3902 3963
@@ -3944,6 +4005,7 @@ emacsclient @trampfn{ssh,$(whoami)@@$(hostname --fqdn),$1}
3944@end group 4005@end group
3945@end example 4006@end example
3946 4007
4008@vindex EDITOR@r{, environment variable}
3947Then change the environment variable @env{EDITOR} to point to the 4009Then change the environment variable @env{EDITOR} to point to the
3948wrapper script: 4010wrapper script:
3949 4011