From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Q on using shell mode remotely
Date: Mon, 31 Jul 2006 11:51:27 -0600 [thread overview]
Message-ID: <ealg1b$jtr$1@sea.gmane.org> (raw)
In-Reply-To: <MEEKKIABFKKDFJMPIOEBMENDDDAA.drew.adams@oracle.com>
Drew Adams wrote:
> When I use M-x telnet, I get a prompt that looks like this:
>
> > 8:34am
>
> I have some Emacs-Lisp code that recognizes the shell prompt, in order to
> let you complete and cycle among past shell inputs. I use
> `comint-prompt-regexp' to recognize the prompt; I subtract the prompt from
> an input line to get the actual command used.
>
> In plain (local) shell mode on Windows, this works fine; there, the prompt I
> see is this: "> ". In telnet mode, however, the time of day interferes. It
> is not actually part of the prompt as understood by Emacs (comint mode) -
> that is, it doesn't match the default value of `comint-prompt-regexp'. For
> both shell and telnet modes, this is the value of `comint-prompt-regexp':
>
> "^[^#$%>\n]*[#$%>] *"
>
> On the remote machine, I do have a right-side prompt variable ($rprompt) set
> to add the time at the *right* side of the screen. I use csh as the
> remote-machine shell, and this is my $prompt:
>
> "%B%.01%b %h:"
>
> This is my $rprompt (it is this that prints the time of day at the right):
>
> "%@"
>
> Through telnet, the time appears next to the left prompt (i.e. at the
> left) - I guess there is no notion of right-side prompt, but it still picks
> up $rprompt and concatenates it to $prompt. Naturally, it is not picked up
> by `comint-prompt-regexp' (which can't know by itself that $rprompt is being
> used and its value is a time-of-day pattern).
>
> Any ideas on how to deal with this? Either 1) how to recognize the presence
> of the added time (appearing at the left) and treat it as part of the
> prompt, or 2) (not as good, because it won't help others who use my code)
> how to tell telnet not to use the time part of the prompt? Is there some
> variable similar to `comint-prompt-regexp' that will pick up $rprompt (or
> the concatenation of $prompt and $rprompt)?
Why can't you just add a time pattern to telnet-prompt-pattern, which is
used to set the buffer-local value of comint-prompt-pattern:
(eval-after-load "telnet"
'(setq telnet-prompt-pattern
(concat telnet-prompt-pattern "\\([12]?[0-9]:[0-5][0-9][ap]m\\)?")))
--
Kevin
next prev parent reply other threads:[~2006-07-31 17:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-28 21:33 Q on using shell mode remotely Drew Adams
2006-07-28 21:37 ` Drew Adams
2006-07-31 15:09 ` Kevin Rodgers
2006-07-31 16:35 ` Drew Adams
2006-07-31 17:51 ` Kevin Rodgers [this message]
2006-07-31 18:05 ` Drew Adams
2006-08-01 23:52 ` Kevin Rodgers
2006-08-02 0:21 ` Emacs\compiling Java Frank Murray
2006-08-02 3:35 ` Eli Zaretskii
2006-08-02 17:54 ` Kevin Rodgers
[not found] ` <mailman.4745.1154478071.9609.help-gnu-emacs@gnu.org>
2006-08-02 11:13 ` Hadron Quark
2006-08-02 15:42 ` Q on using shell mode remotely Drew Adams
2006-08-02 16:33 ` Drew Adams
2006-08-04 8:00 ` Drew Adams
[not found] <mailman.4613.1154122648.9609.help-gnu-emacs@gnu.org>
2006-07-28 21:46 ` David Kastrup
2006-07-28 22:56 ` Drew Adams
2006-07-29 8:33 ` Eli Zaretskii
2006-07-29 13:47 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ealg1b$jtr$1@sea.gmane.org' \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).