all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
@ 2018-06-21  9:09 Tino Calancha
  2018-06-21 11:05 ` Michael Albinus
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2018-06-21  9:09 UTC (permalink / raw)
  To: 31924; +Cc: michael albinus

X-Debbugs-Cc: Michael Albinus <michael.albinus@gmx.de>

$ cat ~/.zshrc
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return

$ sudo cat /root/.zshrc
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return

$ sudo ln -sf /bin/zsh /bin/sh
$ emacs -Q -eval '(setq tramp-verbose 10)'
C-x d /sudo::/bin

;; After 1 minute I canceled the command, i.e. `C-g'
;; Following is the content of the tramp debug buffer:
--8<-----------------------------cut here---------------start------------->8---
;; Emacs: 27.0.50 Tramp: 2.4.0-pre -*- mode: outline; -*-
;; Location: /home/calancha/soft/emacs-master/lisp/net/tramp.elc Git: 5583e6460c38c5d613e732934b066421349a5259
17:57:38.930500 tramp-get-connection-property (7) # case-insensitive undef
17:57:38.931248 tramp-get-file-property (8) # /bin file-directory-p undef
17:57:38.931337 tramp-get-connection-property (7) # test undef
17:57:38.931385 tramp-get-test-command (5) # Finding a suitable ‘test’ command
17:57:38.931437 tramp-get-connection-property (7) # process-name nil
17:57:38.931486 tramp-get-connection-property (7) # process-name nil
17:57:38.931533 tramp-get-connection-property (7) # process-buffer nil
17:57:38.931586 tramp-get-connection-property (7) # process-buffer nil
17:57:38.931627 tramp-set-connection-property (7) # process-buffer nil
17:57:38.931822 tramp-maybe-open-connection (3) # Opening connection for root@calancha-pc.dy.bbexcite.jp using sudo...
17:57:38.933788 tramp-get-local-locale (7) # locale en_US.utf8
17:57:38.934065 tramp-get-connection-property (7) # login-args undef
17:57:38.934225 tramp-get-connection-property (7) # login-args undef
17:57:38.934386 tramp-get-connection-property (7) # process-name nil
17:57:38.934459 tramp-get-connection-property (7) # process-buffer nil
17:57:38.934983 tramp-maybe-open-connection (6) # /bin/sh -i
17:57:38.935092 tramp-get-connection-property (7) # check-remote-echo nil
17:57:38.935183 tramp-get-connection-property (7) # check-remote-echo nil
17:57:38.936253 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run t
%                                                                               
17:57:38.936369 tramp-get-connection-property (7) # check-remote-echo nil
17:57:38.936451 tramp-get-connection-property (7) # check-remote-echo nil
17:57:38.936893 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run t
%                                                                               \r#$ [?2004h
17:57:38.936963 tramp-get-connection-property (7) # check-remote-echo nil
17:57:38.937012 tramp-get-connection-property (7) # check-remote-echo nil
17:57:39.938226 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:39.938337 tramp-get-connection-property (7) # check-remote-echo nil
17:57:39.938394 tramp-get-connection-property (7) # check-remote-echo nil
17:57:40.939619 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:40.939717 tramp-get-connection-property (7) # check-remote-echo nil
17:57:40.939774 tramp-get-connection-property (7) # check-remote-echo nil
17:57:41.941010 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:41.941120 tramp-get-connection-property (7) # check-remote-echo nil
17:57:41.941176 tramp-get-connection-property (7) # check-remote-echo nil
17:57:42.942364 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:42.942474 tramp-get-connection-property (7) # check-remote-echo nil
17:57:42.942533 tramp-get-connection-property (7) # check-remote-echo nil
17:57:43.943718 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:43.943833 tramp-get-connection-property (7) # check-remote-echo nil
17:57:43.943892 tramp-get-connection-property (7) # check-remote-echo nil
17:57:44.945288 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:44.945402 tramp-get-connection-property (7) # check-remote-echo nil
17:57:44.945463 tramp-get-connection-property (7) # check-remote-echo nil
17:57:45.946721 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:45.946823 tramp-get-connection-property (7) # check-remote-echo nil
17:57:45.946904 tramp-get-connection-property (7) # check-remote-echo nil
17:57:46.948155 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:46.948263 tramp-get-connection-property (7) # check-remote-echo nil
17:57:46.948320 tramp-get-connection-property (7) # check-remote-echo nil
17:57:47.949508 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:47.949634 tramp-get-connection-property (7) # check-remote-echo nil
17:57:47.949699 tramp-get-connection-property (7) # check-remote-echo nil
17:57:48.950375 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:48.950485 tramp-get-connection-property (7) # check-remote-echo nil
17:57:48.950545 tramp-get-connection-property (7) # check-remote-echo nil
17:57:49.950749 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:49.950850 tramp-get-connection-property (7) # check-remote-echo nil
17:57:49.950907 tramp-get-connection-property (7) # check-remote-echo nil
17:57:50.952169 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:50.952306 tramp-get-connection-property (7) # check-remote-echo nil
17:57:50.952367 tramp-get-connection-property (7) # check-remote-echo nil
17:57:51.953626 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:51.953726 tramp-get-connection-property (7) # check-remote-echo nil
17:57:51.953783 tramp-get-connection-property (7) # check-remote-echo nil
17:57:52.954980 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:52.955082 tramp-get-connection-property (7) # check-remote-echo nil
17:57:52.955140 tramp-get-connection-property (7) # check-remote-echo nil
17:57:53.956340 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:53.956443 tramp-get-connection-property (7) # check-remote-echo nil
17:57:53.956501 tramp-get-connection-property (7) # check-remote-echo nil
17:57:54.957692 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:54.957802 tramp-get-connection-property (7) # check-remote-echo nil
17:57:54.957874 tramp-get-connection-property (7) # check-remote-echo nil
17:57:55.959064 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:55.959175 tramp-get-connection-property (7) # check-remote-echo nil
17:57:55.959234 tramp-get-connection-property (7) # check-remote-echo nil
17:57:56.960421 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:56.960541 tramp-get-connection-property (7) # check-remote-echo nil
17:57:56.960602 tramp-get-connection-property (7) # check-remote-echo nil
17:57:57.961791 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:57.961904 tramp-get-connection-property (7) # check-remote-echo nil
17:57:57.961964 tramp-get-connection-property (7) # check-remote-echo nil
17:57:58.963150 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:58.963253 tramp-get-connection-property (7) # check-remote-echo nil
17:57:58.963313 tramp-get-connection-property (7) # check-remote-echo nil
17:57:59.964253 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:57:59.964420 tramp-get-connection-property (7) # check-remote-echo nil
17:57:59.964500 tramp-get-connection-property (7) # check-remote-echo nil
17:58:00.965708 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:00.965811 tramp-get-connection-property (7) # check-remote-echo nil
17:58:00.965871 tramp-get-connection-property (7) # check-remote-echo nil
17:58:01.967062 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:01.967184 tramp-get-connection-property (7) # check-remote-echo nil
17:58:01.967248 tramp-get-connection-property (7) # check-remote-echo nil
17:58:02.968435 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:02.968545 tramp-get-connection-property (7) # check-remote-echo nil
17:58:02.968613 tramp-get-connection-property (7) # check-remote-echo nil
17:58:03.969805 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:03.969913 tramp-get-connection-property (7) # check-remote-echo nil
17:58:03.969971 tramp-get-connection-property (7) # check-remote-echo nil
17:58:04.971197 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:04.971300 tramp-get-connection-property (7) # check-remote-echo nil
17:58:04.971358 tramp-get-connection-property (7) # check-remote-echo nil
17:58:05.972615 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:05.972717 tramp-get-connection-property (7) # check-remote-echo nil
17:58:05.972775 tramp-get-connection-property (7) # check-remote-echo nil
17:58:06.973107 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:06.973217 tramp-get-connection-property (7) # check-remote-echo nil
17:58:06.973276 tramp-get-connection-property (7) # check-remote-echo nil
17:58:07.974499 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:07.974606 tramp-get-connection-property (7) # check-remote-echo nil
17:58:07.974664 tramp-get-connection-property (7) # check-remote-echo nil
17:58:08.975880 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:08.975993 tramp-get-connection-property (7) # check-remote-echo nil
17:58:08.976065 tramp-get-connection-property (7) # check-remote-echo nil
17:58:09.976733 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:09.976837 tramp-get-connection-property (7) # check-remote-echo nil
17:58:09.976894 tramp-get-connection-property (7) # check-remote-echo nil
17:58:10.977620 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:10.977720 tramp-get-connection-property (7) # check-remote-echo nil
17:58:10.977777 tramp-get-connection-property (7) # check-remote-echo nil
17:58:11.978996 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:11.979101 tramp-get-connection-property (7) # check-remote-echo nil
17:58:11.979159 tramp-get-connection-property (7) # check-remote-echo nil
17:58:12.980358 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:12.980518 tramp-get-connection-property (7) # check-remote-echo nil
17:58:12.980624 tramp-get-connection-property (7) # check-remote-echo nil
17:58:13.981863 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:13.982062 tramp-get-connection-property (7) # check-remote-echo nil
17:58:13.982173 tramp-get-connection-property (7) # check-remote-echo nil
17:58:14.983483 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:14.983641 tramp-get-connection-property (7) # check-remote-echo nil
17:58:14.983741 tramp-get-connection-property (7) # check-remote-echo nil
17:58:15.984978 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:15.985100 tramp-get-connection-property (7) # check-remote-echo nil
17:58:15.985151 tramp-get-connection-property (7) # check-remote-echo nil
17:58:16.986351 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:16.986507 tramp-get-connection-property (7) # check-remote-echo nil
17:58:16.986606 tramp-get-connection-property (7) # check-remote-echo nil
17:58:17.987829 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:17.987922 tramp-get-connection-property (7) # check-remote-echo nil
17:58:17.987970 tramp-get-connection-property (7) # check-remote-echo nil
17:58:18.988286 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:18.988427 tramp-get-connection-property (7) # check-remote-echo nil
17:58:18.988522 tramp-get-connection-property (7) # check-remote-echo nil
17:58:19.989752 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:19.989918 tramp-get-connection-property (7) # check-remote-echo nil
17:58:19.990037 tramp-get-connection-property (7) # check-remote-echo nil
17:58:20.991300 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:20.991402 tramp-get-connection-property (7) # check-remote-echo nil
17:58:20.991474 tramp-get-connection-property (7) # check-remote-echo nil
17:58:21.992277 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:21.992438 tramp-get-connection-property (7) # check-remote-echo nil
17:58:21.992563 tramp-get-connection-property (7) # check-remote-echo nil
17:58:22.993801 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:22.993902 tramp-get-connection-property (7) # check-remote-echo nil
17:58:22.993952 tramp-get-connection-property (7) # check-remote-echo nil
17:58:23.995116 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:23.995205 tramp-get-connection-property (7) # check-remote-echo nil
17:58:23.995253 tramp-get-connection-property (7) # check-remote-echo nil
17:58:24.996248 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:24.996340 tramp-get-connection-property (7) # check-remote-echo nil
17:58:24.996390 tramp-get-connection-property (7) # check-remote-echo nil
17:58:25.997580 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:25.997720 tramp-get-connection-property (7) # check-remote-echo nil
17:58:25.997805 tramp-get-connection-property (7) # check-remote-echo nil
17:58:26.999037 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:26.999131 tramp-get-connection-property (7) # check-remote-echo nil
17:58:26.999182 tramp-get-connection-property (7) # check-remote-echo nil
17:58:28.000242 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:28.000333 tramp-get-connection-property (7) # check-remote-echo nil
17:58:28.000383 tramp-get-connection-property (7) # check-remote-echo nil
17:58:29.001545 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:29.001645 tramp-get-connection-property (7) # check-remote-echo nil
17:58:29.001696 tramp-get-connection-property (7) # check-remote-echo nil
17:58:30.002340 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:30.002433 tramp-get-connection-property (7) # check-remote-echo nil
17:58:30.002484 tramp-get-connection-property (7) # check-remote-echo nil
17:58:31.003678 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:31.003783 tramp-get-connection-property (7) # check-remote-echo nil
17:58:31.003844 tramp-get-connection-property (7) # check-remote-echo nil
17:58:32.004268 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:32.004356 tramp-get-connection-property (7) # check-remote-echo nil
17:58:32.004427 tramp-get-connection-property (7) # check-remote-echo nil
17:58:33.005613 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:33.005720 tramp-get-connection-property (7) # check-remote-echo nil
17:58:33.005780 tramp-get-connection-property (7) # check-remote-echo nil
17:58:34.006973 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:34.007077 tramp-get-connection-property (7) # check-remote-echo nil
17:58:34.007147 tramp-get-connection-property (7) # check-remote-echo nil
17:58:35.008320 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:35.008420 tramp-get-connection-property (7) # check-remote-echo nil
17:58:35.008485 tramp-get-connection-property (7) # check-remote-echo nil
17:58:36.009666 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:36.009755 tramp-get-connection-property (7) # check-remote-echo nil
17:58:36.009806 tramp-get-connection-property (7) # check-remote-echo nil
17:58:37.011022 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:37.011136 tramp-get-connection-property (7) # check-remote-echo nil
17:58:37.011197 tramp-get-connection-property (7) # check-remote-echo nil
17:58:38.012381 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:38.012485 tramp-get-connection-property (7) # check-remote-echo nil
17:58:38.012545 tramp-get-connection-property (7) # check-remote-echo nil
17:58:39.013737 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:39.013843 tramp-get-connection-property (7) # check-remote-echo nil
17:58:39.013903 tramp-get-connection-property (7) # check-remote-echo nil
17:58:40.015096 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:40.015204 tramp-get-connection-property (7) # check-remote-echo nil
17:58:40.015264 tramp-get-connection-property (7) # check-remote-echo nil
17:58:41.016462 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:41.016567 tramp-get-connection-property (7) # check-remote-echo nil
17:58:41.027721 tramp-get-connection-property (7) # check-remote-echo nil
17:58:42.028335 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:42.028476 tramp-get-connection-property (7) # check-remote-echo nil
17:58:42.028532 tramp-get-connection-property (7) # check-remote-echo nil
17:58:43.029719 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:43.029820 tramp-get-connection-property (7) # check-remote-echo nil
17:58:43.029879 tramp-get-connection-property (7) # check-remote-echo nil
17:58:44.031132 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:44.031231 tramp-get-connection-property (7) # check-remote-echo nil
17:58:44.031287 tramp-get-connection-property (7) # check-remote-echo nil
17:58:45.032506 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:45.032606 tramp-get-connection-property (7) # check-remote-echo nil
17:58:45.032662 tramp-get-connection-property (7) # check-remote-echo nil
17:58:46.033872 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:46.033994 tramp-get-connection-property (7) # check-remote-echo nil
17:58:46.034053 tramp-get-connection-property (7) # check-remote-echo nil
17:58:47.035248 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:47.035351 tramp-get-connection-property (7) # check-remote-echo nil
17:58:47.035408 tramp-get-connection-property (7) # check-remote-echo nil
17:58:48.036630 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:48.036729 tramp-get-connection-property (7) # check-remote-echo nil
17:58:48.036784 tramp-get-connection-property (7) # check-remote-echo nil
17:58:49.038041 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:49.038139 tramp-get-connection-property (7) # check-remote-echo nil
17:58:49.038194 tramp-get-connection-property (7) # check-remote-echo nil
17:58:50.039367 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:50.039472 tramp-get-connection-property (7) # check-remote-echo nil
17:58:50.039531 tramp-get-connection-property (7) # check-remote-echo nil
17:58:51.040790 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:51.040889 tramp-get-connection-property (7) # check-remote-echo nil
17:58:51.040945 tramp-get-connection-property (7) # check-remote-echo nil
17:58:52.042161 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:52.042263 tramp-get-connection-property (7) # check-remote-echo nil
17:58:52.042319 tramp-get-connection-property (7) # check-remote-echo nil
17:58:53.043574 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:53.043672 tramp-get-connection-property (7) # check-remote-echo nil
17:58:53.043728 tramp-get-connection-property (7) # check-remote-echo nil
17:58:54.044950 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:54.045049 tramp-get-connection-property (7) # check-remote-echo nil
17:58:54.045106 tramp-get-connection-property (7) # check-remote-echo nil
17:58:55.046290 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:55.046396 tramp-get-connection-property (7) # check-remote-echo nil
17:58:55.046454 tramp-get-connection-property (7) # check-remote-echo nil
17:58:56.047678 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:56.047978 tramp-get-connection-property (7) # check-remote-echo nil
17:58:56.048082 tramp-get-connection-property (7) # check-remote-echo nil
17:58:57.049340 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:57.049440 tramp-get-connection-property (7) # check-remote-echo nil
17:58:57.049496 tramp-get-connection-property (7) # check-remote-echo nil
17:58:58.050703 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:58.050806 tramp-get-connection-property (7) # check-remote-echo nil
17:58:58.050863 tramp-get-connection-property (7) # check-remote-echo nil
17:58:59.052058 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:58:59.052177 tramp-get-connection-property (7) # check-remote-echo nil
17:58:59.052235 tramp-get-connection-property (7) # check-remote-echo nil
17:59:00.053505 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:59:00.053613 tramp-get-connection-property (7) # check-remote-echo nil
17:59:00.053669 tramp-get-connection-property (7) # check-remote-echo nil
17:59:01.054929 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run nil
%                                                                               \r#$ [?2004h
17:59:01.055028 tramp-get-connection-property (7) # check-remote-echo nil
17:59:01.055085 tramp-get-connection-property (7) # check-remote-echo nil
17:59:01.832162 tramp-maybe-open-connection (3) # Opening connection for root@calancha-pc.dy.bbexcite.jp using sudo...failed
17:59:01.834591 tramp-get-file-property (8) #  file-truename nil
17:59:01.834722 tramp-flush-directory-properties (8) # 
17:59:01.834822 tramp-get-connection-property (7) # process-name nil
17:59:01.834900 tramp-get-connection-property (7) # process-name nil
17:59:01.834991 tramp-flush-connection-properties (7) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* nil
17:59:01.835144 tramp-get-connection-property (7) # process-name nil
17:59:01.835493 tramp-process-sentinel (5) # Sentinel called: ‘#<process *tramp/sudo root@calancha-pc.dy.bbexcite.jp*>’ ‘killed
’
17:59:01.835660 tramp-flush-connection-properties (7) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* nil
17:59:01.835879 tramp-get-file-property (8) #  file-truename nil
17:59:01.836123 tramp-flush-directory-properties (8) # 
17:59:01.838168 tramp-flush-connection-properties (7) # (tramp-file-name sudo root nil calancha-pc.dy.bbexcite.jp nil nil nil) (process-buffer)
17:59:01.839437 tramp-get-connection-property (7) # process-buffer nil
17:59:01.839834 tramp-file-name-handler (1) # Interrupt received in operation (file-directory-p /sudo:root@calancha-pc.dy.bbexcite.jp:/bin)

--8<-----------------------------cut here---------------end--------------->8---


In GNU Emacs 27.0.50 (build 18, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-06-21 built on calancha-pc.dy.bbexcite.jp
Repository revision: 5583e6460c38c5d613e732934b066421349a5259
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)






^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-21  9:09 bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh Tino Calancha
@ 2018-06-21 11:05 ` Michael Albinus
  2018-06-24  7:07   ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2018-06-21 11:05 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

thanks for the traces. Tramp doesn't run too much. First, it invokes the
local shell:

> 17:57:38.934983 tramp-maybe-open-connection (6) # /bin/sh -i

And this returns a nifty prompt:

> 17:57:38.936893 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run t
> %                                                                               #$ [?2004h

That's it. According to
<https://emacs.stackexchange.com/questions/19848/weird-characters-in-shell-mode-with-zsh>,
"^[[?2004h" is good for bracketed paste mode. This must be disabled as
well, the reference I've quoted recommends "unset
zle_bracketed_paste". As said, I have no idea how this plays together
with what is already recommended for zsh in the Tramp manual.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-21 11:05 ` Michael Albinus
@ 2018-06-24  7:07   ` Tino Calancha
  2018-06-24  7:15     ` Tino Calancha
  2018-06-24 10:33     ` Michael Albinus
  0 siblings, 2 replies; 15+ messages in thread
From: Tino Calancha @ 2018-06-24  7:07 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 31924, tino.calancha

Michael Albinus <michael.albinus@gmx.de> writes:

> Tino Calancha <tino.calancha@gmail.com> writes:
>
> Hi Tino,
>
> thanks for the traces. Tramp doesn't run too much. First, it invokes the
> local shell:
>
>> 17:57:38.934983 tramp-maybe-open-connection (6) # /bin/sh -i
>
> And this returns a nifty prompt:
>
>> 17:57:38.936893 tramp-accept-process-output (10) # *tramp/sudo root@calancha-pc.dy.bbexcite.jp* run t
>> %                                                                               #$ [?2004h
>
> That's it. According to
> <https://emacs.stackexchange.com/questions/19848/weird-characters-in-shell-mode-with-zsh>,
> "^[[?2004h" is good for bracketed paste mode. This must be disabled as
> well, the reference I've quoted recommends "unset
> zle_bracketed_paste". As said, I have no idea how this plays together
> with what is already recommended for zsh in the Tramp manual.
Hi Michael,

I got a patch that works in my box.  It does 2 things:

1) Ensure that zsh is invoked as zsh, that is, not as sh.  Otherwise
   our dotfiles are ignored, and we keep getting the bracketed paste
   codes.
   
2) I also need to disable the zsh option promptcr, otherwise after I
introduce my root password, Emacs gets stuck in `tramp-wait-for-output';
this is becuse some '\r' are added in front the prompt, so the
regexp in ``tramp-wait-for-regexp' cannot match.
--8<-----------------------------cut here---------------start------------->8---
commit 30f90a77db4dc1ebe5c98ab33f36ddffd5302b50
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Sun Jun 24 16:03:40 2018 +0900

    Tramp: Handle /sudo::FILE when /bin/sh points to zsh
    
    If zsh is invoked as sh, then the dotfiles, e.g. ~/.zshrc., aren't read.
    We also need to unset the option promptcr, otherwise
    `tramp-wait-for-output' gets stuck.
    * lisp/net/tramp-sh.el (tramp-maybe-open-connection):
    Use (file-truename tramp-encoding-shell) as the PROGRAM
    in the `start-process' call (Bug#31924).
    
    * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
    Same.
    
    * lisp/net/tramp-sh.el (tramp-sh-extra-args): Don't add CR to the
    zsh prompt.

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 26bf3cd0c0..49963bff9d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -550,7 +550,9 @@ tramp-remote-process-environment
   :type '(repeat string))
 
 ;;;###tramp-autoload
-(defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
+(defcustom tramp-sh-extra-args
+  '(("/bash\\'" . "-norc -noprofile")
+    ("/zsh\\'" . "--no-promptcr"))
   "Alist specifying extra arguments to pass to the remote shell.
 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
 matching the shell file name and ARGS is a string specifying the
@@ -4110,7 +4112,11 @@ tramp-open-connection-setup-interactive-shell
 process to set up.  VEC specifies the connection."
   (let ((tramp-end-of-output tramp-initial-end-of-output)
 	(case-fold-search t))
-    (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell))
+    (tramp-open-shell
+     vec
+     (if (not (equal "sudo" (tramp-file-name-method vec)))
+         (tramp-get-method-parameter vec 'tramp-remote-shell)
+       (file-truename (tramp-get-method-parameter vec 'tramp-remote-shell))))
 
     ;; Disable echo expansion.
     (tramp-message vec 5 "Setting up remote shell environment")
@@ -4793,6 +4799,7 @@ tramp-maybe-open-connection
 		     ;; W32 systems.
 		     (process-coding-system-alist nil)
 		     (coding-system-for-read nil)
+		     (enconding-shell (file-truename tramp-encoding-shell))
 		     ;; This must be done in order to avoid our file
 		     ;; name handler.
 		     (p (let ((default-directory
@@ -4802,9 +4809,9 @@ tramp-maybe-open-connection
 			   (tramp-get-connection-name vec)
 			   (tramp-get-connection-buffer vec)
 			   (if tramp-encoding-command-interactive
-			       (list tramp-encoding-shell
+			       (list encoding-shell
 				     tramp-encoding-command-interactive)
-			     (list tramp-encoding-shell))))))
+			     (list encoding-shell))))))
 
 		;; Set sentinel and query flag.  Initialize variables.
 		(set-process-sentinel p 'tramp-process-sentinel)
@@ -4819,7 +4826,7 @@ tramp-maybe-open-connection
 		;; Check whether process is alive.
 		(tramp-barf-if-no-shell-prompt
 		 p 10
-		 "Couldn't find local shell prompt for %s" tramp-encoding-shell)
+		 "Couldn't find local shell prompt for %s" encoding-shell)
 
 		;; Now do all the connections as specified.
 		(while target-alist
@@ -4834,7 +4841,12 @@ tramp-maybe-open-connection
 			 (login-args
 			  (tramp-get-method-parameter hop 'tramp-login-args))
 			 (login-env
-			  (tramp-get-method-parameter hop 'tramp-login-env))
+			  (if (not (equal "sudo" (tramp-file-name-method vec)))
+			      (tramp-get-method-parameter hop 'tramp-login-env)
+			    (cl-letf ((tmp-login-env
+			               (tramp-get-method-parameter hop 'tramp-login-env)))
+			      (setf (caadr tmp-login-env) (file-truename (caadr tmp-login-env)))
+			      tmp-login-env)))
 			 (async-args
 			  (tramp-get-method-parameter hop 'tramp-async-args))
 			 (connection-timeout
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 49, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-06-24 built on calancha-pc.dy.bbexcite.jp
Repository revision: 6ffc6a698f5d425e402c35010394cdb17d8888ce
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-24  7:07   ` Tino Calancha
@ 2018-06-24  7:15     ` Tino Calancha
  2018-06-24 10:33     ` Michael Albinus
  1 sibling, 0 replies; 15+ messages in thread
From: Tino Calancha @ 2018-06-24  7:15 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

>  
>      ;; Disable echo expansion.
>      (tramp-message vec 5 "Setting up remote shell environment")
> @@ -4793,6 +4799,7 @@ tramp-maybe-open-connection
>  		     ;; W32 systems.
>  		     (process-coding-system-alist nil)
>  		     (coding-system-for-read nil)
> +		     (enconding-shell (file-truename tramp-encoding-shell))
             ^^^^^^^^^^^^^^^^
This must read 'encoding-shell'.
Sometimes the '\r' (\015) appears in the second line of the buffer.
I can live with that, but it would be cool if we could make dissapear
such \015.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-24  7:07   ` Tino Calancha
  2018-06-24  7:15     ` Tino Calancha
@ 2018-06-24 10:33     ` Michael Albinus
  2018-06-25  1:36       ` Tino Calancha
  1 sibling, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2018-06-24 10:33 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

> Hi Michael,

Hi Tino,

> I got a patch that works in my box.  It does 2 things:
>
> 1) Ensure that zsh is invoked as zsh, that is, not as sh.  Otherwise
>    our dotfiles are ignored, and we keep getting the bracketed paste
>    codes.
>    
> 2) I also need to disable the zsh option promptcr, otherwise after I
> introduce my root password, Emacs gets stuck in `tramp-wait-for-output';
> this is becuse some '\r' are added in front the prompt, so the
> regexp in ``tramp-wait-for-regexp' cannot match.

Point 2) is OK. But your solution for point 1) doesn't work in general.

> @@ -4110,7 +4112,11 @@ tramp-open-connection-setup-interactive-shell
>  process to set up.  VEC specifies the connection."
>    (let ((tramp-end-of-output tramp-initial-end-of-output)
>  	(case-fold-search t))
> -    (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell))
> +    (tramp-open-shell
> +     vec
> +     (if (not (equal "sudo" (tramp-file-name-method vec)))
> +         (tramp-get-method-parameter vec 'tramp-remote-shell)
> +       (file-truename (tramp-get-method-parameter vec 'tramp-remote-shell))))

In tramp-sh.el, there shall be no code which relies on a given
method. Everything which is method specific, must be configured in
`tramp-methods'.

Furthermore, this code does not work at all. (file-truename "/bin/sh")
is always eval'ed on the local host, but you want to get information
about the remote host.

The better solution is to overwrite the `tramp-remote-shell' connection
property. Do something like this:

     (add-to-list 'tramp-connection-properties
                  (list (regexp-quote "/ssh:user@randomhost.your.domain:")
                        "remote-shell" "/bin/zsh"))

See the Tramp manual, (info "(tramp) Predefined connection information")

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-24 10:33     ` Michael Albinus
@ 2018-06-25  1:36       ` Tino Calancha
  2018-06-25 12:54         ` Michael Albinus
  2018-06-25 15:22         ` Eli Zaretskii
  0 siblings, 2 replies; 15+ messages in thread
From: Tino Calancha @ 2018-06-25  1:36 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 31924, tino.calancha

Michael Albinus <michael.albinus@gmx.de> writes:

> Tino Calancha <tino.calancha@gmail.com> writes:
>
>> Hi Michael,
>
> Hi Tino,
>
>> I got a patch that works in my box.  It does 2 things:
>>
>> 1) Ensure that zsh is invoked as zsh, that is, not as sh.  Otherwise
>>    our dotfiles are ignored, and we keep getting the bracketed paste
>>    codes.
>>    
>> 2) I also need to disable the zsh option promptcr, otherwise after I
>> introduce my root password, Emacs gets stuck in `tramp-wait-for-output';
>> this is becuse some '\r' are added in front the prompt, so the
>> regexp in ``tramp-wait-for-regexp' cannot match.
>
> Point 2) is OK. But your solution for point 1) doesn't work in general.
Please consider to apply the restricted patch at the end of this
message.  It's clean and it doesn't add method specific stuff.

I have successfully connected into a remote machine using this patch,
with my local machine having:
/bin/sh -> /bin/zsh


>> @@ -4110,7 +4112,11 @@ tramp-open-connection-setup-interactive-shell
>>  process to set up.  VEC specifies the connection."
>>    (let ((tramp-end-of-output tramp-initial-end-of-output)
>>  	(case-fold-search t))
>> -    (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell))
>> +    (tramp-open-shell
>> +     vec
>> +     (if (not (equal "sudo" (tramp-file-name-method vec)))
>> +         (tramp-get-method-parameter vec 'tramp-remote-shell)
>> +       (file-truename (tramp-get-method-parameter vec 'tramp-remote-shell))))
>
> In tramp-sh.el, there shall be no code which relies on a given
> method. Everything which is method specific, must be configured in
> `tramp-methods'.
Do you want to support /sudo when the local machine has
/bin/sh -> /bin/zsh?
* If yes: then we obviously need to introduce changes in the code; it's
  a pity not supporting out of the box, i.e., with emacs -Q,
  a great shell as zsh is.

* If no: then I suggest explicitely say in the manual that such
configuration won't work.  Currently the manual suggest a workaround
that cannot work, because our .zshrc is ignored.  Reading the manual
that is not obvious for the reader.

> Furthermore, this code does not work at all. (file-truename "/bin/sh")
> is always eval'ed on the local host, but you want to get information
> about the remote host.
Have you tried it? It works for me :-) and pretty well, actually.
As you know better than me, the remote host _is_ just the local host
when you are invoking /sudo method.

> The better solution is to overwrite the `tramp-remote-shell' connection
> property. Do something like this:
>
>      (add-to-list 'tramp-connection-properties
>                   (list (regexp-quote "/ssh:user@randomhost.your.domain:")
>                         "remote-shell" "/bin/zsh"))
>
> See the Tramp manual, (info "(tramp) Predefined connection information")
I am afraid this doesn't fix the issue.
* It won't work with emacs -Q
--8<-----------------------------cut here---------------start------------->8---
commit 789f6d789b93f87be4732a03c607a6a5b59dbaf0
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Mon Jun 25 09:58:05 2018 +0900

    Tramp: Remote connection when local /bin/sh points to zsh
    
    The dotfiles, e.g. ~/.zshrc., aren't read if zsh is invoked as sh.
    We also need to unset the option promptcr, otherwise
    `tramp-wait-for-output' might get stuck.
    
    * lisp/net/tramp-sh.el (tramp-maybe-open-connection):
    Use (file-truename tramp-encoding-shell) as the PROGRAM
    in the `start-process' call (Bug#31924).
    
    (tramp-sh-extra-args): Don't add CR to the zsh prompt.

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 63b39a0378..ce196ff80e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -550,7 +550,9 @@ tramp-remote-process-environment
   :type '(repeat string))
 
 ;;;###tramp-autoload
-(defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
+(defcustom tramp-sh-extra-args
+  '(("/bash\\'" . "-norc -noprofile")
+    ("/zsh\\'" . "--no-promptcr"))
   "Alist specifying extra arguments to pass to the remote shell.
 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
 matching the shell file name and ARGS is a string specifying the
@@ -4792,6 +4794,7 @@ tramp-maybe-open-connection
 		     ;; W32 systems.
 		     (process-coding-system-alist nil)
 		     (coding-system-for-read nil)
+		     (encoding-shell (file-truename tramp-encoding-shell))
 		     ;; This must be done in order to avoid our file
 		     ;; name handler.
 		     (p (let ((default-directory
@@ -4801,9 +4804,9 @@ tramp-maybe-open-connection
 			   (tramp-get-connection-name vec)
 			   (tramp-get-connection-buffer vec)
 			   (if tramp-encoding-command-interactive
-			       (list tramp-encoding-shell
+			       (list encoding-shell
 				     tramp-encoding-command-interactive)
-			     (list tramp-encoding-shell))))))
+			     (list encoding-shell))))))
 
 		;; Set sentinel and query flag.  Initialize variables.
 		(set-process-sentinel p 'tramp-process-sentinel)
@@ -4818,7 +4821,7 @@ tramp-maybe-open-connection
 		;; Check whether process is alive.
 		(tramp-barf-if-no-shell-prompt
 		 p 10
-		 "Couldn't find local shell prompt for %s" tramp-encoding-shell)
+		 "Couldn't find local shell prompt for %s" encoding-shell)
 
 		;; Now do all the connections as specified.
 		(while target-alist

--8<-----------------------------cut here---------------end--------------->8---





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-25  1:36       ` Tino Calancha
@ 2018-06-25 12:54         ` Michael Albinus
  2019-10-09 11:00           ` Michael Albinus
  2018-06-25 15:22         ` Eli Zaretskii
  1 sibling, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2018-06-25 12:54 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

> Please consider to apply the restricted patch at the end of this
> message.  It's clean and it doesn't add method specific stuff.
>
> I have successfully connected into a remote machine using this patch,
> with my local machine having:
> /bin/sh -> /bin/zsh

Looks OK to me. You could install it into master.

>> In tramp-sh.el, there shall be no code which relies on a given
>> method. Everything which is method specific, must be configured in
>> `tramp-methods'.
>
> Do you want to support /sudo when the local machine has
> /bin/sh -> /bin/zsh?
> * If yes: then we obviously need to introduce changes in the code; it's
>   a pity not supporting out of the box, i.e., with emacs -Q,
>   a great shell as zsh is.

We shall try it.

>> Furthermore, this code does not work at all. (file-truename "/bin/sh")
>> is always eval'ed on the local host, but you want to get information
>> about the remote host.
> Have you tried it? It works for me :-) and pretty well, actually.
> As you know better than me, the remote host _is_ just the local host
> when you are invoking /sudo method.

Not always. Think about a remote file name "/ssh:remotehost|sudo:remotehost:".
The remote host is _not_ just the local host.

So we must refrain from

+    (tramp-open-shell
+     vec
+     (if (not (equal "sudo" (tramp-file-name-method vec)))
+         (tramp-get-method-parameter vec 'tramp-remote-shell)
+       (file-truename (tramp-get-method-parameter vec 'tramp-remote-shell))))

as shown in your first patch variant. Instead of using `file-truename',
one must run something like

--8<---------------cut here---------------start------------->8---
(tramp-open-shell
 vec
 (tramp-send-command-and-read
  vec (format "readlink --canonicalize %s"
              (tramp-get-method-parameter vec 'tramp-remote-shell))))
--8<---------------cut here---------------end--------------->8---

Completely untested.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-25  1:36       ` Tino Calancha
  2018-06-25 12:54         ` Michael Albinus
@ 2018-06-25 15:22         ` Eli Zaretskii
  1 sibling, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2018-06-25 15:22 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924, michael.albinus

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 25 Jun 2018 10:36:39 +0900
> Cc: 31924@debbugs.gnu.org, tino.calancha@gmail.com
> 
> --- a/lisp/net/tramp-sh.el
> +++ b/lisp/net/tramp-sh.el
> @@ -550,7 +550,9 @@ tramp-remote-process-environment
>    :type '(repeat string))
>  
>  ;;;###tramp-autoload
> -(defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
> +(defcustom tramp-sh-extra-args
> +  '(("/bash\\'" . "-norc -noprofile")
> +    ("/zsh\\'" . "--no-promptcr"))

If you change the default value of a defcustom, please update its
:version tag.

Thanks.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2018-06-25 12:54         ` Michael Albinus
@ 2019-10-09 11:00           ` Michael Albinus
  2019-10-16 10:41             ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2019-10-09 11:00 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Tino,

>> Please consider to apply the restricted patch at the end of this
>> message.  It's clean and it doesn't add method specific stuff.
>>
>> I have successfully connected into a remote machine using this patch,
>> with my local machine having:
>> /bin/sh -> /bin/zsh
>
> Looks OK to me. You could install it into master.

Somehow, this patch hasn't been applied ever. And there were also
problems with multi-hop, IIRC. Hmm.

Some weeks ago, I've worked on support of zsh in Tramp for remote
shells. So I've taken the opportunity to come back to this bug, which is
about the local (encoding) shell being zsh.

I've applied a patch to Emacs master, which should fix this. Could you
please test? All you need is to run (setq tramp-encoding-shell "/usr/bin/zsh")
in advance, which tells Tramp to use the proper arguments from
`tramp-sh-extra-args'.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-09 11:00           ` Michael Albinus
@ 2019-10-16 10:41             ` Tino Calancha
  2019-10-16 11:01               ` Michael Albinus
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2019-10-16 10:41 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 31924

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]



On Wed, 9 Oct 2019, Michael Albinus wrote:

> I've applied a patch to Emacs master, which should fix this. Could you
> please test? All you need is to run (setq tramp-encoding-shell "/usr/bin/zsh")
> in advance, which tells Tramp to use the proper arguments from
> `tramp-sh-extra-args'.

>I've applied a patch to Emacs master, which should fix this. Could you
>please test? All you need is to run (setq tramp-encoding-shell "/usr/bin/zsh")
>in advance, which tells Tramp to use the proper arguments from
>`tramp-sh-extra-args'.

It's not working for me :-(
  After I set `tramp-encidng-shell', tramp
detects the shell extra arguments, as you can see here:

10:14:09.547170 tramp-maybe-open-connection (6) # /usr/bin/zsh -i -f +Z -V

But apparently, those options are been ignored because I still see those 
funny characters after the prompt (I mean, [?2004h ) causing the time out 
(I hide the IP with MACHINE_IP):

10:14:19.556057 tramp-flush-connection-properties (7) # *tramp/sudo root@ip-MACHINE_IP* (temp-file password-vector session-timeout last-cmd-time)
10:14:19.556173 tramp-get-file-property (8) #  file-truename nil
10:14:19.556233 tramp-flush-directory-properties (8) # 
10:14:19.556912 tramp-get-connection-property (7) # process-buffer nil
10:14:19.556995 tramp-get-connection-property (7) # process-buffer nil
10:14:19.557108 tramp-process-actions (1) # File error: Timeout reached, see buffer ‘*tramp/sudo root@ip-MACHINE_IP*’ for details
#                                                                               #$ ^[[?2004h
10:14:34.916278 tramp-process-actions (3) # Waiting for prompts from remote shell...failed
10:14:34.916546 tramp-maybe-open-connection (3) # Opening connection for root@ip-MACHINE_IP using sudo...failed

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-16 10:41             ` Tino Calancha
@ 2019-10-16 11:01               ` Michael Albinus
  2019-10-16 11:36                 ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2019-10-16 11:01 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

>> I've applied a patch to Emacs master, which should fix this. Could you
>> please test? All you need is to run (setq tramp-encoding-shell "/usr/bin/zsh")
>> in advance, which tells Tramp to use the proper arguments from
>> `tramp-sh-extra-args'.

> It's not working for me :-(
>  After I set `tramp-encidng-shell', tramp
> detects the shell extra arguments, as you can see here:

Unfortunately, I don't see anything. Could you please start a new Emacs
stanze via "emacs -Q -l tramp", and eval the form

(setq tramp-encoding-shell "/usr/bin/zsh"
      tramp-verbose 10)

Then open a remote file (it's sudo'ed, isn't it?), and after the error,
pls send me the complete Tramp debug buffer.

For privacy reasons, you could replace user name and host name with a
pattern of your choice. Or you send the debug buffer off-list, to me.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-16 11:01               ` Michael Albinus
@ 2019-10-16 11:36                 ` Tino Calancha
  2019-10-16 13:21                   ` Michael Albinus
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2019-10-16 11:36 UTC (permalink / raw)
  To: 31924



On Wed, 16 Oct 2019, Michael Albinus wrote:

> Unfortunately, I don't see anything. Could you please start a new Emacs
> stanze via "emacs -Q -l tramp", and eval the form
>
> (setq tramp-encoding-shell "/usr/bin/zsh"
>      tramp-verbose 10)
>
> Then open a remote file (it's sudo'ed, isn't it?), and after the error,
> pls send me the complete Tramp debug buffer.

Sent offlist to Michael the content of the tramp debug buffers.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-16 11:36                 ` Tino Calancha
@ 2019-10-16 13:21                   ` Michael Albinus
  2019-10-17 15:24                     ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Albinus @ 2019-10-16 13:21 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

>> Then open a remote file (it's sudo'ed, isn't it?), and after the error,
>> pls send me the complete Tramp debug buffer.
>
> Sent offlist to Michael the content of the tramp debug buffers.

Thanks, this made it obvious what happened. I could reproduce it locally.

When I've fixed this bug, I've tested with the ssh method. sudo is kinda
different, I have adapted now the template for calling it.

Works for me now also with sudo. Pushed to master. Could you pls check?

When you recompile the pulled sources, you need also to regenerate
tramp-loaddefs.el. This is not performed by default, so I suggest to
apply at least

--8<---------------cut here---------------start------------->8---
make -C lisp autoloads all
--8<---------------cut here---------------end--------------->8---

Note also, that you need both these settings

--8<---------------cut here---------------start------------->8---
(setq tramp-encoding-shell "/usr/bin/zsh")
(add-to-list
 'tramp-connection-properties '("^/sudo:" "remote-shell" "/usr/bin/zsh"))
--8<---------------cut here---------------end--------------->8---

Of course, you could apply any regexp instead of "^/sudo:". If you take
nil instead, "/usr/bin/zsh" would run on all your remote hosts.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-16 13:21                   ` Michael Albinus
@ 2019-10-17 15:24                     ` Tino Calancha
  2019-10-17 16:24                       ` Michael Albinus
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2019-10-17 15:24 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 31924



On Wed, 16 Oct 2019, Michael Albinus wrote:

> When I've fixed this bug, I've tested with the ssh method. sudo is kinda
> different, I have adapted now the template for calling it.
>
> Works for me now also with sudo. Pushed to master. Could you pls check?
Good job Michael, I confirm now it's working in all my machines.

Thank you, I think you might want to close the bug now.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
  2019-10-17 15:24                     ` Tino Calancha
@ 2019-10-17 16:24                       ` Michael Albinus
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Albinus @ 2019-10-17 16:24 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 31924-done

Version: 27.1

Tino Calancha <tino.calancha@gmail.com> writes:

> Good job Michael, I confirm now it's working in all my machines.
>
> Thank you, I think you might want to close the bug now.

Yes, I'm closing it.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-10-17 16:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-21  9:09 bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh Tino Calancha
2018-06-21 11:05 ` Michael Albinus
2018-06-24  7:07   ` Tino Calancha
2018-06-24  7:15     ` Tino Calancha
2018-06-24 10:33     ` Michael Albinus
2018-06-25  1:36       ` Tino Calancha
2018-06-25 12:54         ` Michael Albinus
2019-10-09 11:00           ` Michael Albinus
2019-10-16 10:41             ` Tino Calancha
2019-10-16 11:01               ` Michael Albinus
2019-10-16 11:36                 ` Tino Calancha
2019-10-16 13:21                   ` Michael Albinus
2019-10-17 15:24                     ` Tino Calancha
2019-10-17 16:24                       ` Michael Albinus
2018-06-25 15:22         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.