lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev LYNX: catch ^C's --> "are you sure?" (excellent!)


From: Henry Nelson
Subject: Re: lynx-dev LYNX: catch ^C's --> "are you sure?" (excellent!)
Date: Thu, 31 Jul 2003 10:51:41 +0900 (JST)

> > I've always expected ^C to stop a running program unconditionally, i.e.,
> > stop the process and return to the shell.  Just about any program I can
> 
> You have never used vi, or less then.

I do not use less.  I use vi all the time.  Quite true that vi does not
accept ^C -- exactly the same as you can do with Lynx if you compile
with -DIGNORE_CTRL_C.  The difference is that if you do something that
locks vi up (e.g., try to read a shift-jis encoded file on a terminal
ready for euc-jp), the only way to get to the shell is to disconnect on the
terminal side (either physically or via the terminal emulation software),
and then login again.  (Or as Tom mentioned, if you're running screen or
some such, you can kill the process from another pseudo-terminal.)  In
either case, vi has lost its recover capabilities (state?).

> > think of acts this way.  I don't understand what "return to the basic
> 
> Only badly written programs and non-interactive programs work like this.
> Well written interactive programs return to the program's command
> prompt from any long running operations, e.g. vi will abandon any very
> long running search and replace.

?  The vi I'm using at the moment (/usr/bin/vi, Solaris2.6) doesn't do
anything with ^C other than issue a bell.

> > the same time) _by accident_.  If it's so easy to mistakenly hit ^C by
> 
> I do it quite often, although sometimes it's actually control-\, for 
> SIGQUIT that I probably hit.

Curious.  Why are you (and the originator of this thread) using SIGQUIT
("hitting control-\") or SIGINT ("hitting control-c") so often that you
mistakenly hit those.  Or is it that your Ctrl key and Shift key are very
close and you're intending "C" or "_"?  If the latter is the case, then
I would recommend that you compile Lynx to ignore ^C.  (Or buy a different
keyboard with Ctrl to the left of "a".  :)

Tom hinted at this, but a small coding project for someone might be to
do something a little more savvy than simply ignore.  Anyone who has
used mailx would know.  It catches the first ^C, and issues a message
that another ^C will return the user unconditionally to the shell, and
lose everything.  Not "are you sure?" (excellent!)", but "Hit ^C again
to terminate Lynx."

> > ^G also seems fairly common amongst programs that I use regularly, with the
> > meaning to cancel the immediate action and return to the previous mode.
> 
> I've never seen that on any other program (DOS or Unix), and the OS

At the moment only mutt and most (the reason I don't use less) come to mind.
My "fairly common amongst programs that I use regularly" was an exaggeration.
Should be "common amongst the two programs that I use daily."

> Normally configured shells ignore SIGINT, relying on return codes from
> terminated programs.^^^^^^

Sounds good.

__Henry

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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