displayed only when the command generates output, set
@code{async-shell-command-display-buffer} to @code{nil}.
+@vindex async-shell-command-width
+ The option @code{async-shell-command-width} defines the number of display
+columns available for output of asynchronous shell commands.
+A positive integer tells the shell to use that number of columns for
+command output. The default value is @code{nil} that means to use
+the same number of columns as provided by the shell.
+
@kindex M-|
@findex shell-command-on-region
@kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but
section, these variables can be changed via connection-local
variables.
-@vindex shell-command-width
+@vindex async-shell-command-width
@vindex COLUMNS@r{, environment variable}
-If Emacs supports the variable @code{shell-command-width} (since Emacs
+If Emacs supports the variable @code{async-shell-command-width} (since Emacs
27.1), @value{tramp} cares about its value for asynchronous shell
commands. It specifies the number of display columns for command
output. For synchronous shell commands, a similar effect can be
** Single shell commands
---
-*** 'shell-command-width' defines the number of display columns
-available for output of asynchronous or remote shell commands.
+*** 'async-shell-command-width' defines the number of display columns
+available for output of asynchronous shell commands.
** Pcomplete
(if (and (not current-buffer-p) (integerp asynchronous))
(let ((tramp-remote-process-environment
- ;; `shell-command-width' has been introduced with Emacs 27.1.
- (if (natnump (bound-and-true-p shell-command-width))
+ ;; `async-shell-command-width' has been introduced with Emacs 27.1.
+ (if (natnump (bound-and-true-p async-shell-command-width))
(cons (format "COLUMNS=%d"
- (bound-and-true-p shell-command-width))
+ (bound-and-true-p async-shell-command-width))
tramp-remote-process-environment)
tramp-remote-process-environment)))
(prog1
:group 'shell
:version "26.1")
-(defcustom shell-command-width nil
+(defcustom async-shell-command-width nil
"Number of display columns available for asynchronous shell command output.
If nil, use the shell default number (usually 80 columns).
If a positive integer, tell the shell to use that number of columns for
(shell-command--save-pos-or-erase)
(setq default-directory directory)
(let ((process-environment
- (if (natnump shell-command-width)
- (cons (format "COLUMNS=%d" shell-command-width)
+ (if (natnump async-shell-command-width)
+ (cons (format "COLUMNS=%d" async-shell-command-width)
process-environment)
process-environment)))
(setq proc
;; Cleanup.
(ignore-errors (delete-file tmp-name)))
- ;; Test `shell-command-width' of `async-shell-command'.
- ;; Since Emacs 27.1.
- (when (and (boundp 'shell-command-width)
+ ;; Test `async-shell-command-width'. Since Emacs 27.1.
+ (when (and (boundp 'async-shell-command-width)
(zerop (call-process "tput" nil nil nil "cols"))
(zerop (process-file "tput" nil nil nil "cols")))
- (let (shell-command-width)
+ (let (async-shell-command-width)
(should
(string-equal
(format "%s\n" (car (process-lines "tput" "cols")))
(tramp--test-shell-command-to-string-asynchronously
"tput cols")))
- (setq shell-command-width 1024)
+ (setq async-shell-command-width 1024)
(should
(string-equal
"1024\n"