tramp-devel
[Top][All Lists]
Advanced

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

[PATCH] Fix regexps for coloured shell prompts, and a typo.


From: Steve Youngs
Subject: [PATCH] Fix regexps for coloured shell prompts, and a typo.
Date: Fri, 19 Jul 2002 08:38:08 +1000
User-agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.5 (broccoflower, i686-pc-linux)

Hi Kai!

Without this patch I was getting a void variable error and couldn't
connect to any user/host that used colour control characters in the
shell prompt.

BTW, what happened to the "tramp-checkins" list?  I'm not getting CVS
commit notices anymore. :-(

NOTE: This patch has been committed.


Tramp patch:
ChangeLog files diff command: cvs -q diff -U 0
Files affected:               lisp/ChangeLog
Source files diff command:    cvs -q diff -uN
Files affected:               lisp/tramp.el

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/tramp/tramp/lisp/ChangeLog,v
retrieving revision 2.127
diff -u -U0 -r2.127 ChangeLog
--- lisp/ChangeLog      18 Jul 2002 19:43:52 -0000      2.127
+++ lisp/ChangeLog      18 Jul 2002 22:34:54 -0000
@@ -0,0 +1,20 @@
+2002-07-19  Steve Youngs  <address@hidden>
+
+       * tramp.el (tramp-find-shell): Remove "\\'" from regexp so we can
+       deal with shell prompts that have colour control characters in
+       them. 
+       (tramp-open-connection-telnet): Ditto.
+       (tramp-open-connection-rsh): Ditto.
+       (tramp-open-connection-su): Ditto.
+       (tramp-open-connection-multi): Ditto.
+       (tramp-multi-connect-telnet): Ditto.
+       (tramp-multi-connect-rlogin): Ditto.
+       (tramp-multi-connect-su): Ditto.
+       (tramp-open-connection-setup-interactive-shell): Ditto.
+
+2002-07-18  Steve Youngs  <address@hidden>
+
+       * tramp.el (tramp-multi-file-name-structure-separate): Typo, it's
+       name was set to 'tramp-file-name-structure-separate'.
+       
+
Index: lisp/tramp.el
===================================================================
RCS file: /cvsroot/tramp/tramp/lisp/tramp.el,v
retrieving revision 2.131
diff -u -u -r2.131 tramp.el
--- lisp/tramp.el       18 Jul 2002 19:43:52 -0000      2.131
+++ lisp/tramp.el       18 Jul 2002 22:34:40 -0000
@@ -1124,7 +1124,7 @@
 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
 See `tramp-file-name-structure-unified' for details.")
 
-(defconst tramp-file-name-structure-separate
+(defconst tramp-multi-file-name-structure-separate
   (list (concat
          ;; prefix
          "\\`/\\[\\(\\([a-z0-9]+\\)?\\)"
@@ -3570,7 +3570,7 @@
        (concat "PS1='$ ' ; exec " shell)) ;
       (unless (tramp-wait-for-regexp
                (get-buffer-process (current-buffer))
-               60 (format "\\(\\$ *\\|\\(%s\\)\\'\\)" shell-prompt-pattern))
+               60 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
         (pop-to-buffer (buffer-name))
         (error "Couldn't find remote `%s' prompt." shell))
       (process-send-string nil (format "PS1='%s%s%s'; PS2=''; PS3=''%s"
@@ -3713,7 +3713,7 @@
         (tramp-message 9 "Waiting 30s for remote shell to come up...")
         (unless (setq found
                       (tramp-wait-for-regexp
-                       p 30 (format "\\(%s\\)\\|\\(%s\\)\\'"
+                       p 30 (format "\\(%s\\)\\|\\(%s\\)"
                                     tramp-wrong-passwd-regexp
                                     shell-prompt-pattern)))
           (pop-to-buffer (buffer-name))
@@ -3787,7 +3787,7 @@
               (tramp-wait-for-regexp
                p 60
                (format
-                "\\(%s\\)\\|\\(%s\\)\\'"
+                "\\(%s\\)\\|\\(%s\\)"
                 tramp-password-prompt-regexp
                 shell-prompt-pattern)))
         (unless found
@@ -3806,7 +3806,7 @@
           (tramp-enter-password p (nth 1 found))
           (tramp-message 9 "Sent password, waiting 60s for remote shell 
prompt")
           (setq found (tramp-wait-for-regexp p 60
-                                             (format "\\(%s\\)\\|\\(%s\\)\\'"
+                                             (format "\\(%s\\)\\|\\(%s\\)"
                                                      tramp-wrong-passwd-regexp
                                                      shell-prompt-pattern))))
         (unless found
@@ -3872,7 +3872,7 @@
         (tramp-message 9 "Waiting 30s for shell or password prompt...")
         (unless (setq found (tramp-wait-for-regexp
                              p 30
-                             (format "\\(%s\\)\\|\\(%s\\)\\'"
+                             (format "\\(%s\\)\\|\\(%s\\)"
                                      tramp-password-prompt-regexp
                                      shell-prompt-pattern)))
           (pop-to-buffer (buffer-name))
@@ -3886,7 +3886,7 @@
           (tramp-message 9 "Waiting 30s for remote shell to come up..."
   (erase-buffer)
   (process-send-string nil (format "TERM=dumb; export TERM%s"
                                    tramp-rsh-end-of-line))
   (unless (tramp-wait-for-regexp
-          p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+          p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
     (pop-to-buffer (buffer-name))
     (error "Couldn't `TERM=dumb; export TERM', see buffer `%s'" (buffer-name)))
   ;; Try to set up the coding system correctly.
@@ -4232,7 +4232,7 @@
     (process-send-string nil (format "echo foo ; echo bar %s"
                                      tramp-rsh-end-of-line))
     (unless (tramp-wait-for-regexp
-             p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+             p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
       (pop-to-buffer (buffer-name))
       (error "Couldn't `echo foo; echo bar' to determine line endings'"))
     (goto-char (point-min))
@@ -4260,7 +4260,7 @@
         (tramp-message 9 "Trying `stty -onlcr'")
         (process-send-string nil (format "stty -onlcr%s" 
tramp-rsh-end-of-line))
         (unless (tramp-wait-for-regexp
-                 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+                 p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
           (pop-to-buffer (buffer-name))
           (error "Couldn't `stty -onlcr', see buffer `%s'" (buffer-name))))))
   (erase-buffer)
@@ -4270,7 +4270,7 @@
    nil (format "HISTFILE=$HOME/.tramp_history; HISTSIZE=1%s"
                tramp-rsh-end-of-line))
   (unless (tramp-wait-for-regexp
-           p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+           p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
     (pop-to-buffer (buffer-name))
     (error (concat "Couldn't `HISTFILE=$HOME/.tramp_history; "
                    "HISTSIZE=1', see buffer `%s'")
@@ -4281,7 +4281,7 @@
    nil (format "set +o vi +o emacs%s"      ;mustn't `>/dev/null' with AIX?
                tramp-rsh-end-of-line))
   (unless (tramp-wait-for-regexp
-           p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+           p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
     (pop-to-buffer (buffer-name))
     (error "Couldn't `set +o vi +o emacs', see buffer `%s'"
            (buffer-name)))
@@ -4291,7 +4291,7 @@
    nil (format "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null%s"
                tramp-rsh-end-of-line))
   (unless (tramp-wait-for-regexp
-           p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+           p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
     (pop-to-buffer (buffer-name))
     (error "Couldn't `unset MAIL MAILCHECK MAILPATH', see buffer `%s'"
            (buffer-name)))
@@ -4300,7 +4300,7 @@
   (process-send-string
    nil (format "unset CDPATH%s" tramp-rsh-end-of-line))
   (unless (tramp-wait-for-regexp
-           p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
+           p 30 (format "\\(\\$ *\\|%s\\)" shell-prompt-pattern))
     (pop-to-buffer (buffer-name))
     (error "Couldn't `unset CDPATH', see buffer `%s'"
            (buffer-name)))

-- 
|---<Steve Youngs>---------------<GnuPG KeyID: 10D5C9C5>---|
|            XEmacs - It's not just an editor.             |
|                    It's a way of life.                   |
|------------------------------------<address@hidden>---|



reply via email to

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