From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: Q on using shell mode remotely
Date: Mon, 31 Jul 2006 09:35:11 -0700 [thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBMENDDDAA.drew.adams@oracle.com> (raw)
In-Reply-To: <eal6hj$g7e$2@sea.gmane.org>
Drew Adams wrote:
> My question is: can you use shell mode remotely? ...
> If so, how?
M-x telnet
Love it! Thanks, Kevin, once again!
This responds perfectly to what I was asking for. (I've used telnet a lot,
of course, but I didn't know that Emacs had a telnet mode.) This will save
me a lot of time futzing around with Tarantella and VNC.
I'm embarassed that I didn't find this on my own, especially since it is
mentioned in the Emacs manual, at least as far back as Emacs 20. RTFM Drew!
Thx.
I do have another question now, for anyone:
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)?
Note: I'm not interested in hearing about things like
`comint-previous-matching-input' and `comint-previous-prompt' as the
solution here. I'm not looking for how to find previous inputs using vanilla
Emacs. Likewise, I'm not interested here in solutions that tell me how to
use the shell itself to reuse past commands. I want to enable my own
complete-and-cycle Emacs-Lisp code to work with the time-of-day that
$rprompt adds and telnet seems to stick on the left, after the $prompt. FYI,
my code is described here: http://www.emacswiki.org/cgi-bin/wiki/Icicles ...
(the site is down at the moment, so I can't give the exact URL - if you're
interested, look for Other Search Commands on this table-of-contents page).
next prev parent reply other threads:[~2006-07-31 16:35 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 [this message]
2006-07-31 17:51 ` Kevin Rodgers
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=MEEKKIABFKKDFJMPIOEBMENDDDAA.drew.adams@oracle.com \
--to=drew.adams@oracle.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).