tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tramp-send-string doens't send end-of-line ?


From: Stéphane Sénési
Subject: tramp-send-string doens't send end-of-line ?
Date: Wed, 13 Mar 2013 07:11:02 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130221 Thunderbird/17.0.3

Dear all, and Michael

I tried the method described in the doc under "remote shell setup hints", namely :
           (defconst my-tramp-prompt-regexp
             (concat (regexp-opt '("Enter the birth date of your mother:") t)
                     "\\s-*")
             "Regular expression matching my login prompt question.")

           (defun my-tramp-action (proc vec)
             "Enter \"19000101\" in order to give a correct answer."
             (save-window-excursion
               (with-current-buffer (tramp-get-connection-buffer vec)
                 (tramp-message vec 6 "\n%s" (buffer-string))
                 (tramp-send-string vec "19000101"))))

           (add-to-list 'tramp-actions-before-shell
                        '(my-tramp-prompt-regexp my-tramp-action))
with only few changes.

From what appears in my tramp debug buffer (with verbosity level 6), it looks like there is no "end-of-line" character sent by tramp-send-string. I tried to add one in the argument to tramp-send-string, namely writing :
    (tramp-send-string vec "abcd\n" )
or even,
    (tramp-send-string vec "abcd\nefgh\n" )
In that last case, the tramp-buffer will show :
    abcdefgh

I guess that I misunderstand how to embed an end-of-line in an Emacs-lisp string; but I expected (from the discussion at http://lists.gnu.org/archive/html/tramp-devel/2013-02/msg00009.html) that it was not necessary to provide an end-of-line to tramp-send-string

Any hint ?
Note : In my context, tramp-rsh-end-of-line's value is "\n", Emacs version is 23.3.1, Tramp version is 2.1.20


Best regards

--
Stéphane Sénési
7 Allée Victor Capoul
F-31770 Colomiers
+33.6.81.25.94.15




reply via email to

[Prev in Thread] Current Thread [Next in Thread]