* bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
@ 2018-02-24 18:07 Mathieu Othacehe
2018-02-26 15:59 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Othacehe @ 2018-02-24 18:07 UTC (permalink / raw)
To: 30595; +Cc: Mathieu Othacehe
The command sent to an adb shell input might be wrapped around
terminal column count by the kernel. Remove CR and LF introduced when
it happends.
* lisp/net/tramp-adb.el (tramp-adb-send-command): Remove W32 trailing
CR but also CR/LF introduced by command line wrapping.
---
lisp/net/tramp-adb.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index be269aca51..532569414b 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1178,14 +1178,17 @@ tramp-adb-send-command
(with-current-buffer (tramp-get-connection-buffer vec)
(save-excursion
(goto-char (point-min))
- ;; We can't use stty to disable echo of command.
- (delete-matching-lines (regexp-quote command))
;; When the local machine is W32, there are still trailing ^M.
;; There must be a better solution by setting the correct coding
;; system, but this requires changes in core Tramp.
+ ;;
+ ;; Also remove CR and LF introduced by kernel when input command
+ ;; is longer than terminal column count.
+ (while (re-search-forward "\r+\n*" nil t)
+ (replace-match "" nil nil))
(goto-char (point-min))
- (while (re-search-forward "\r+$" nil t)
- (replace-match "" nil nil)))))
+ ;; We can't use stty to disable echo of command.
+ (delete-matching-lines (regexp-quote command)))))
(defun tramp-adb-send-command-and-check (vec command)
"Run COMMAND and check its exit status.
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
2018-02-24 18:07 bug#30595: [PATCH] Handle command line wrapping in Tramp adb Mathieu Othacehe
@ 2018-02-26 15:59 ` Michael Albinus
2018-02-27 17:13 ` Mathieu Othacehe
0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-02-26 15:59 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 30595
Mathieu Othacehe <m.othacehe@gmail.com> writes:
Hi Mathieu,
> The command sent to an adb shell input might be wrapped around
> terminal column count by the kernel. Remove CR and LF introduced when
> it happends.
Your patch doesn't pass Tramp's test suite, using my plain Galaxy S6. It
fails in tramp-test09-insert-file-contents. Could you, pls, check?
In order to run the test suite in Tramp's git repository, apply
$ env REMOTE_TEMPORARY_FILE_DIRECTORY=/adb::/sdcard/tmp make check
If you use Emacs' git repository instead, apply
$ env REMOTE_TEMPORARY_FILE_DIRECTORY=/adb::/sdcard/tmp \
make check -C test tramp-tests
(You might use another temporary directory on your device.)
Pls sync first with the git repository; I've pushed a patch earlier
today fixing another nasty (unrelated) bug which let Tramp fail in test.
Btw, your other patch wrt bug#30594 runs OK with the tests.
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
2018-02-26 15:59 ` Michael Albinus
@ 2018-02-27 17:13 ` Mathieu Othacehe
2018-05-14 11:09 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Othacehe @ 2018-02-27 17:13 UTC (permalink / raw)
To: Michael Albinus; +Cc: 30595
Hi Michael,
> Pls sync first with the git repository; I've pushed a patch earlier
> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>
> Btw, your other patch wrt bug#30594 runs OK with the tests.
Ok I'll try to understand why it breaks tramp tests.
Thanks for pushing the previous patch,
Mathieu
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
2018-02-27 17:13 ` Mathieu Othacehe
@ 2018-05-14 11:09 ` Michael Albinus
2018-06-05 11:09 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-05-14 11:09 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 30595
Mathieu Othacehe <m.othacehe@gmail.com> writes:
> Hi Michael,
Hi Mathieu,
>> Pls sync first with the git repository; I've pushed a patch earlier
>> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>
> Ok I'll try to understand why it breaks tramp tests.
Ping.
> Mathieu
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
2018-05-14 11:09 ` Michael Albinus
@ 2018-06-05 11:09 ` Michael Albinus
0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2018-06-05 11:09 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 30595
Michael Albinus <michael.albinus@gmx.de> writes:
> Mathieu Othacehe <m.othacehe@gmail.com> writes:
Hi Mathieu,
>>> Pls sync first with the git repository; I've pushed a patch earlier
>>> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>>
>> Ok I'll try to understand why it breaks tramp tests.
>
> Ping.
No progress, so I'm closing the bug. If you still intend to propose a
patch, you could reply.
>> Mathieu
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-06-05 11:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-24 18:07 bug#30595: [PATCH] Handle command line wrapping in Tramp adb Mathieu Othacehe
2018-02-26 15:59 ` Michael Albinus
2018-02-27 17:13 ` Mathieu Othacehe
2018-05-14 11:09 ` Michael Albinus
2018-06-05 11:09 ` Michael Albinus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).