Ticket #1860 (assigned defect)

Opened 5 years ago

Last modified 3 years ago

Ctrl+C misbehaviour in input-line

Reported by: gintautas.m@… Owned by: mutt-dev
Priority: minor Milestone:
Component: mutt Version: 1.5.5.1+cvs20040105i
Keywords: patch Cc:

Description

Package: mutt
Version: 1.5.5.1-200401
Severity: normal

-- Please type your report below this line

Mutt behaves oddly in entry mode - by entry mode I mean the one where you can
enter text to the line at the bottom of the screen (e.g. after pressing ':'
or 'm' or many other commands) - when I use Escape and then <Ctrl+C>.

Let me explain by example; try typing in these keystrokes:
mfoo<Esc><Ctrl+C>nbar
You will see that you are still in entry mode, but the label 'To: ' is not
visible any more and the 'b' has been interpreted as <Esc>b or C-b meaning "go
to start of the line".

I think Ctrl+C should abort text entry in this case because that's what it does
when <Esc> is not involved.

-- System Information
System Version: Linux gintm 2.6.5 #3 Sat Apr 17 01:27:20 EEST 2004 i686 GNU/Linux

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
cc
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040401)

- CFLAGS
-Wall -pedantic -g -O2

-- Mutt Version Information

Mutt 1.5.5.1+cvs20040105i (2003-11-05)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.5 (i686) [using ncurses 5.3] [using libidn 0.4.1 (compiled with 0.3.4)]
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  +IMAP_EDIT_THREADS  -USE_GSS  -USE_SSL  +USE_GNUTLS  +USE_SASL  +USE_SASL2  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please use the flea(1) utility.

patch-1.5.5.1.tt.compat.1-cl
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.3.rr.compressed.1
patch-1.5.4.helmersson.incomplete_multibyte
patch-1.5.4.fw.maildir_inode_sort
patch-1.3.23.1.ametzler.pgp_good_sign
patch-1.5.3.Md.gpg_status_fd
patch-1.4.Md.gpg-agent
patch-1.5.3.Md.etc_mailname_gethostbyname
patch-1.5.1.cd.edit_threads.9.2
patch-1.3.27.bse.xtitles.1
Md.use_debian_editor
Md.muttbug
patch-1.4.admcd.gnutlsdlopen.53d
patch-1.4.admcd.gnutlsbuild.53d
patch-1.4.admcd.gnutls.56d

--- Begin /home/gintas/.muttrc
set mbox_type=Maildir
set spoolfile=+Local
set move=no
set mark_old=no
set beep=no
unset wait_key
set envelope_from=yes
set sort=threads
set sort_aux=date-sent
set ignore_list_reply_to
hdr_order From From: To: Cc: Subject: Date: X-Note: X-Mailer: User-Agent: Content-Type:
ignore *
unignore From: To: Cc: Subject: X-Mailer: User-Agent:
set mailcap_path="~/.mutt/mailcap"
auto_view text/html
alternative_order text/enriched text/plain text text/html
set index_format="%4C %Z %{%b %d %H:%M} %-20.20L %s"
set pager_index_lines=8
set pager_stop
set tilde
set include=yes
set reverse_alias
set editor="vim '+set expandtab' '+set textwidth=72'"
set attribution="Hello,\n"
set edit_headers=yes
charset-hook windows-1257 cp1257
set allow_8bit
set send_charset="us-ascii:iso-8859-1:windows-1257:utf-8"
set tmpdir="~/tmp"
set signature="~/.mutt/signature"
set sig_dashes=yes
set postponed=+postponed
set record=+sent
set save_name=no
source "~/.mutt/aliases"
source "~/.mutt/lists"
source "~/.mutt/hooks"
source "~/.mutt/mboxes"
source "~/.mutt/colors"
source "~/.mutt/keys"
source "~/.mutt/gpg"
--- End /home/gintas/.muttrc


--- Begin /etc/Muttrc
ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines
ignore date delivered-to precedence errors-to in-reply-to user-agent
ignore x-loop x-sender x-mailer x-msmail-priority x-mimeole x-priority
ignore x-accept-language x-authentication-warning thread- priority
bind editor    "\e<delete>"    kill-word
bind editor    "\e<backspace>" kill-word
bind editor     <delete>  delete-char
unset use_domain
unset use_from
set sort=threads
unset write_bcc
unset bounce_delivered
macro index \eb '/~b ' 'search in message bodies'
macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'
set pipe_decode
macro generic <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
macro index   <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
macro pager   <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
open-hook	\\.gz$ "gzip -cd %f > %t"
close-hook	\\.gz$ "gzip -c %t > %f"
append-hook	\\.gz$ "gzip -c %t >> %f"
open-hook	\\.bz2$ "bzip2 -cd %f > %t"
close-hook	\\.bz2$ "bzip2 -c %t > %f"
append-hook	\\.bz2$ "bzip2 -c %t >> %f"
color normal	white black
color attachment brightyellow black
color hdrdefault cyan black
color indicator black cyan
color markers	brightred black
color quoted	green black
color signature cyan black
color status	brightgreen blue
color tilde	blue black
color tree	red black
set pgp_decode_command="gpg  --charset utf-8   --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet  --batch  --output - %f"
set pgp_verify_command="gpg   --status-fd=2 --no-verbose --quiet  --batch  --output - --verify %s %f"
set pgp_decrypt_command="gpg   --status-fd=2 --passphrase-fd 0 --no-verbose --quiet  --batch  --output - %f"
set pgp_sign_command="gpg    --no-verbose --batch --quiet   --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg   --charset utf-8 --no-verbose --batch --quiet   --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg  --charset utf-8    --batch  --quiet  --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg  --charset utf-8 --passphrase-fd 0  --batch --quiet  --no-verbose  --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_import_command="gpg  --no-verbose --import %f"
set pgp_export_command="gpg   --no-verbose --export --armor %k"
set pgp_verify_key_command="gpg   --verbose --batch  --fingerprint --check-sigs %r"
set pgp_list_pubring_command="gpg   --no-verbose --batch --quiet   --with-colons --list-keys %k" 
set pgp_list_secring_command="gpg   --no-verbose --batch --quiet   --with-colons --list-secret-keys %k" 
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
set smime_ca_location="~/.smime/ca-bundle.crt"
set smime_certificates="~/.smime/certificates"
set smime_keys="~/.smime/keys"
set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out"
set smime_get_cert_command="openssl pkcs7 -print_certs -in %f"
set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null"
set smime_get_cert_email_command="openssl x509 -in %f -noout -email"
set smime_import_cert_command="smime_keys add_cert %f"
set smime_encrypt_command="openssl smime -encrypt -%a -outform DER -in %f %c"
set smime_sign_command="openssl smime -sign -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER"
set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c"
set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f"
set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s %C"
--- End /etc/Muttrc



>How-To-Repeat:
>Fix:

Change History

Changed 5 years ago by gintautas.m@…

Package: mutt
Version: 1.5.5.1-200401
Severity: normal

-- Please type your report below this line

Mutt behaves oddly in entry mode - by entry mode I mean the one where you can
enter text to the line at the bottom of the screen (e.g. after pressing ':'
or 'm' or many other commands) - when I use Escape and then <Ctrl+C>.

Let me explain by example; try typing in these keystrokes:
mfoo<Esc><Ctrl+C>nbar
You will see that you are still in entry mode, but the label 'To: ' is not
visible any more and the 'b' has been interpreted as <Esc>b or C-b meaning "go
to start of the line".

I think Ctrl+C should abort text entry in this case because that's what it does
when <Esc> is not involved.

-- System Information
System Version: Linux gintm 2.6.5 #3 Sat Apr 17 01:27:20 EEST 2004 i686 GNU/Linux

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
cc
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040401)

- CFLAGS
-Wall -pedantic -g -O2

-- Mutt Version Information

Mutt 1.5.5.1+cvs20040105i (2003-11-05)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.5 (i686) [using ncurses 5.3] [using libidn 0.4.1 (compiled with 0.3.4)]
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  +IMAP_EDIT_THREADS  -USE_GSS  -USE_SSL  +USE_GNUTLS  +USE_SASL  +USE_SASL2  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please use the flea(1) utility.

patch-1.5.5.1.tt.compat.1-cl
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.3.rr.compressed.1
patch-1.5.4.helmersson.incomplete_multibyte
patch-1.5.4.fw.maildir_inode_sort
patch-1.3.23.1.ametzler.pgp_good_sign
patch-1.5.3.Md.gpg_status_fd
patch-1.4.Md.gpg-agent
patch-1.5.3.Md.etc_mailname_gethostbyname
patch-1.5.1.cd.edit_threads.9.2
patch-1.3.27.bse.xtitles.1
Md.use_debian_editor
Md.muttbug
patch-1.4.admcd.gnutlsdlopen.53d
patch-1.4.admcd.gnutlsbuild.53d
patch-1.4.admcd.gnutls.56d

--- Begin /home/gintas/.muttrc
set mbox_type=Maildir
set spoolfile=+Local
set move=no
set mark_old=no
set beep=no
unset wait_key
set envelope_from=yes
set sort=threads
set sort_aux=date-sent
set ignore_list_reply_to
hdr_order From From: To: Cc: Subject: Date: X-Note: X-Mailer: User-Agent: Content-Type:
ignore *
unignore From: To: Cc: Subject: X-Mailer: User-Agent:
set mailcap_path="~/.mutt/mailcap"
auto_view text/html
alternative_order text/enriched text/plain text text/html
set index_format="%4C %Z %{%b %d %H:%M} %-20.20L %s"
set pager_index_lines=8
set pager_stop
set tilde
set include=yes
set reverse_alias
set editor="vim '+set expandtab' '+set textwidth=72'"
set attribution="Hello,\n"
set edit_headers=yes
charset-hook windows-1257 cp1257
set allow_8bit
set send_charset="us-ascii:iso-8859-1:windows-1257:utf-8"
set tmpdir="~/tmp"
set signature="~/.mutt/signature"
set sig_dashes=yes
set postponed=+postponed
set record=+sent
set save_name=no
source "~/.mutt/aliases"
source "~/.mutt/lists"
source "~/.mutt/hooks"
source "~/.mutt/mboxes"
source "~/.mutt/colors"
source "~/.mutt/keys"
source "~/.mutt/gpg"
--- End /home/gintas/.muttrc


--- Begin /etc/Muttrc
ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines
ignore date delivered-to precedence errors-to in-reply-to user-agent
ignore x-loop x-sender x-mailer x-msmail-priority x-mimeole x-priority
ignore x-accept-language x-authentication-warning thread- priority
bind editor    "\e<delete>"    kill-word
bind editor    "\e<backspace>" kill-word
bind editor     <delete>  delete-char
unset use_domain
unset use_from
set sort=threads
unset write_bcc
unset bounce_delivered
macro index \eb '/~b ' 'search in message bodies'
macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'
set pipe_decode
macro generic <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
macro index   <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
macro pager   <f1> "!zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager\n" "Show Mutt documentation"
open-hook	\\.gz$ "gzip -cd %f > %t"
close-hook	\\.gz$ "gzip -c %t > %f"
append-hook	\\.gz$ "gzip -c %t >> %f"
open-hook	\\.bz2$ "bzip2 -cd %f > %t"
close-hook	\\.bz2$ "bzip2 -c %t > %f"
append-hook	\\.bz2$ "bzip2 -c %t >> %f"
color normal	white black
color attachment brightyellow black
color hdrdefault cyan black
color indicator black cyan
color markers	brightred black
color quoted	green black
color signature cyan black
color status	brightgreen blue
color tilde	blue black
color tree	red black
set pgp_decode_command="gpg  --charset utf-8   --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet  --batch  --output - %f"
set pgp_verify_command="gpg   --status-fd=2 --no-verbose --quiet  --batch  --output - --verify %s %f"
set pgp_decrypt_command="gpg   --status-fd=2 --passphrase-fd 0 --no-verbose --quiet  --batch  --output - %f"
set pgp_sign_command="gpg    --no-verbose --batch --quiet   --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg   --charset utf-8 --no-verbose --batch --quiet   --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg  --charset utf-8    --batch  --quiet  --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg  --charset utf-8 --passphrase-fd 0  --batch --quiet  --no-verbose  --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_import_command="gpg  --no-verbose --import %f"
set pgp_export_command="gpg   --no-verbose --export --armor %k"
set pgp_verify_key_command="gpg   --verbose --batch  --fingerprint --check-sigs %r"
set pgp_list_pubring_command="gpg   --no-verbose --batch --quiet   --with-colons --list-keys %k" 
set pgp_list_secring_command="gpg   --no-verbose --batch --quiet   --with-colons --list-secret-keys %k" 
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
set smime_ca_location="~/.smime/ca-bundle.crt"
set smime_certificates="~/.smime/certificates"
set smime_keys="~/.smime/keys"
set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out"
set smime_get_cert_command="openssl pkcs7 -print_certs -in %f"
set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null"
set smime_get_cert_email_command="openssl x509 -in %f -noout -email"
set smime_import_cert_command="smime_keys add_cert %f"
set smime_encrypt_command="openssl smime -encrypt -%a -outform DER -in %f %c"
set smime_sign_command="openssl smime -sign -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER"
set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c"
set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f"
set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s %C"
--- End /etc/Muttrc

Changed 5 years ago by Christoph Berg <cb@…>

tags 1860 + patch
thanks

Re: gintautas.m@takas.lt in <E1BFAld-0000jF-O4@localhost>
> Mutt behaves oddly in entry mode - by entry mode I mean the one where youcan
> enter text to the line at the bottom of the screen (e.g. after pressing ':'
> or 'm' or many other commands) - when I use Escape and then <Ctrl+C>.

Confirmed, patch attached.

diff -urp ../MUTT/mutt/curs_lib.c mutt/curs_lib.c
--- ../MUTT/mutt/curs_lib.c     2003-09-19 15:03:25.000000000 +0200
+++ mutt/curs_lib.c     2004-04-18 15:55:50.000000000 +0200
@@ -62,7 +62,7 @@ event_t mutt_getch (void)
  int ch;
  event_t err = {-1, OP_NULL }, ret;
 
-  if (!option(OPTUNBUFFEREDINPUT) && UngetCount)
+  if (!option(OPTUNBUFFEREDINPUT) && (UngetCount > 0))
    return (KeyEvent[--UngetCount]);
 
  SigInt = 0;

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/

Changed 5 years ago by Christoph Berg <cb@…>

tags 1860 + patch
thanks

Re: gintautas.m@takas.lt in <E1BFAld-0000jF-O4@localhost>
> Mutt behaves oddly in entry mode - by entry mode I mean the one where youcan
> enter text to the line at the bottom of the screen (e.g. after pressing ':'
> or 'm' or many other commands) - when I use Escape and then <Ctrl+C>.

Confirmed, patch attached.

diff -urp ../MUTT/mutt/curs_lib.c mutt/curs_lib.c
--- ../MUTT/mutt/curs_lib.c     2003-09-19 15:03:25.000000000 +0200
+++ mutt/curs_lib.c     2004-04-18 15:55:50.000000000 +0200
@@ -62,7 +62,7 @@ event_t mutt_getch (void)
  int ch;
  event_t err = {-1, OP_NULL }, ret;
 
-  if (!option(OPTUNBUFFEREDINPUT) && UngetCount)
+  if (!option(OPTUNBUFFEREDINPUT) && (UngetCount > 0))
    return (KeyEvent[--UngetCount]);
 
  SigInt = 0;

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/

Changed 5 years ago by Christoph Berg <cb@…>

Re: Gintautas in <20040418144204.GA29918@gintas.pov.lt>
> Are you absolutely sure this patch should fix the problem? I just
> applied it to the latest CVS version of mutt and the problem is still
> there.

Gnarf, I was confused by the OPTMETAKEY handling part that calls
mutt_ungetch. Then Murphy struck me, because the error didn't show up in
the tests afterwards, but of course was still present after reading your
message.

Here's the correct patch:

diff -urp ../MUTT/mutt/curs_lib.c mutt/curs_lib.c
--- ../MUTT/mutt/curs_lib.c	2003-09-19 15:03:25.000000000 +0200
+++ mutt/curs_lib.c	2004-04-18 17:59:59.000000000 +0200
@@ -76,8 +76,10 @@ event_t mutt_getch (void)
    ch = getch ();
  mutt_allow_interrupt (0);
 
-  if (SigInt)
+  if (SigInt) {
    mutt_query_exit ();
+    return err;
+  }
 
  if(ch == ERR)
    return err;
@@ -88,12 +90,12 @@ event_t mutt_getch (void)
    ch &= ~0x80;
    mutt_ungetch (ch, 0);
    ret.ch = '\033';
-    ret.op = 0;
+    ret.op = OP_NULL;
    return ret;
  }
 
  ret.ch = ch;
-  ret.op = 0;
+  ret.op = OP_NULL;
  return (ch == ctrl ('G') ? err : ret);
}
 

(The latter two changes streamline ret.op with OP_NULL in the definition
of err.ret.)

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/

Changed 5 years ago by Gintautas <gintautas.m@…>

Hello,

> > Mutt behaves oddly in entry mode - by entry mode I mean the one where you can
> > enter text to the line at the bottom of the screen (e.g. after pressing':'
> > or 'm' or many other commands) - when I use Escape and then <Ctrl+C>.
> 
> Confirmed, patch attached.
> 
> diff -urp ../MUTT/mutt/curs_lib.c mutt/curs_lib.c
> --- ../MUTT/mutt/curs_lib.c     2003-09-19 15:03:25.000000000 +0200
> +++ mutt/curs_lib.c     2004-04-18 15:55:50.000000000 +0200
> @@ -62,7 +62,7 @@ event_t mutt_getch (void)
>    int ch;
>    event_t err = {-1, OP_NULL }, ret;
>  
> -  if (!option(OPTUNBUFFEREDINPUT) && UngetCount)
> +  if (!option(OPTUNBUFFEREDINPUT) && (UngetCount > 0))
>      return (KeyEvent[--UngetCount]);
>  
>    SigInt = 0;

Are you absolutely sure this patch should fix the problem? I just
applied it to the latest CVS version of mutt and the problem is still
there. I added a printf just above the line you changed and it appears
that UngetCount is always zero.

`ldd mutt` shows that mutt is linked to ncurses.

Am I doing something wrong?

-- 
Gintautas

Changed 5 years ago by Gintautas <gintautas.m@…>

Hello,

> Here's the correct patch:
> <...>
> (The latter two changes streamline ret.op with OP_NULL in the definition
> of err.ret.)

Yep, this patch worked just fine. Problem solved.

Thanks for your surprisingly quick response.

-- 
Gintautas

Changed 3 years ago by rado

  • status changed from new to assigned
working patch provided

Changed 3 years ago by rado

clarified subject
Note: See TracTickets for help on using tickets.