[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35055: 27.0.50; async-shell-command truncates output lines
From: |
Michael Albinus |
Subject: |
bug#35055: 27.0.50; async-shell-command truncates output lines |
Date: |
Fri, 05 Apr 2019 14:35:22 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Juri Linkov <juri@linkov.net> writes:
Hi Juri,
>>> That's because Tramp sets process property `adjust-window-size-function'
>>> to `ignore' (and not to nil as I wrote above). This was 2 years ago;
>>> unfortunately, I have neither a bug nor a message reference for that change.
>>
>> Then I don't understand why remote shell output is limited to 80 columns
>> when Tramp sets `adjust-window-size-function' to `ignore', i.e. not to 80.
>
> We could add a new defcustom process-window-width with a choice of
> a numeric value to set COLUMNS env variable in the process, or
> a symbol `window-width' to set COLUMNS to the width of the output
> buffer's window. Then it will handle both asynchronous processes
> and synchronous remote shell commands as well.
Would be possible. However, I wouldn't speak about COLUMNS of the
underlying process, because this is implementation detail. For remote
processes the process object you see is related to the *local* process
Tramp has opened. But we want to influence the *remote* process, which
has been started from the local process via ssh (for example).
The following code snippet does this already (with an example value of
1024 chars for the width)
--8<---------------cut here---------------start------------->8---
(defun set-fixed-process-window-width ()
(let ((proc (get-buffer-process (current-buffer))))
(set-process-window-size proc (window-body-height (selected-window)) 1024)
;; Don't change size when Emacs window changes.
(process-put proc 'adjust-window-size-function #'ignore)))
(add-hook 'shell-mode-hook 'set-fixed-process-window-width)
--8<---------------cut here---------------end--------------->8---
You can test it like this, for example
--8<---------------cut here---------------start------------->8---
(shell-command-to-string "ps aux")
(shell-command-to-string "ps aux &")
--8<---------------cut here---------------end--------------->8---
or in a shell
--8<---------------cut here---------------start------------->8---
M-x shell
## in the *shell* buffer
$ echo $COLUMNS
1024
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/01
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/01
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/02
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/03
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/04
- bug#35055: 27.0.50; async-shell-command truncates output lines,
Michael Albinus <=
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/06
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/07
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/07
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/08
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/08
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/13
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/13
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/14
- bug#35055: 27.0.50; async-shell-command truncates output lines, Juri Linkov, 2019/04/14
- bug#35055: 27.0.50; async-shell-command truncates output lines, Michael Albinus, 2019/04/15