When using backspace to delete characters from an input field (like when composing a message, or saving tagged messages to a folder), I expect holding down backspace to erase all text already entered after the prompt (including any supplied default), and then have no further effect once the leftmost character is deleted.
Backspacing past the beginning of the prompt is as if I had pressed ENTER without deleting anything, accepting the default value the input field was filled with.
The user has tagged a large number of messages, intending to save them all to a different folder. The user types 芦;s=soon-but-not-immediate禄 out of habit, without watching the command line, and doesn't notice what folder was originally placed on the command line based on the save-hook for the first tagged message. The first message happens to match the save-hook for "=spam" (it received a marginally-positive spam score from spamassassin, but was a false positive).
Before hitting enter on the ;s=soon-but-not-immediate command, the user changes his mind and decides to save them to the =handle-now folder, so he presses and holds the backspace key.
Oops! Now all those messages are moved to the spam folder.
Always.
When I upgraded to the latest version available in Debian sometime late 2019; probably 2019-11-02, possibly 2019-10-25.
2018-07-16 release was probably fine.
NeoMutt 20191111
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.
System: Linux 4.4.214-vs2.3.9.8 (x86_64)
ncurses: ncurses 6.1.20191019 (compiled with 6.1.20191019)
libidn: 1.33 (compiled with 1.33)
GPGme: 1.13.1-unknown
hcache backends: tokyocabinet
Compiler:
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 9.2.1-19' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191109 (Debian 9.2.1-19)
Configure options: --build=x86_64-linux-gnu --prefix=/usr {--includedir=${prefix}/include} {--mandir=${prefix}/share/man} {--infodir=${prefix}/share/info} --sysconfdir=/etc --localstatedir=/var --disable-silent-rules {--libdir=${prefix}/lib/x86_64-linux-gnu} {--libexecdir=${prefix}/lib/x86_64-linux-gnu} --disable-maintainer-mode --disable-dependency-tracking --mandir=/usr/share/man --libexecdir=/usr/libexec --with-mailpath=/var/mail --gpgme --lua --notmuch --with-ui --gnutls --gss --idn --mixmaster --sasl --tokyocabinet
Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/neomutt-jdVSn8/neomutt-20191111+dfsg.1=. -fstack-protector-strong -Wformat -Werror=format-security -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -I/usr/include/lua5.3 -DNCURSES_WIDECHAR -isystem /usr/include/mit-krb5
Default options:
+attach_headers_color +compose_to_sender +compress +cond_date +debug
+encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
+initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
+progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
+skip_quoted +smtp +status_color +timeout +tls_sni +trash
Compile options:
-autocrypt +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens
+getaddrinfo +gnutls +gpgme +gss +hcache -homespool +idn +inotify
-locales_hack +lua +meta +mixmaster +nls +notmuch -openssl +pgp +sasl +smime
-sqlite +start_color +sun_attachment +typeahead
MAILPATH="/var/mail"
MIXMASTER="mixmaster"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"
To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
https://github.com/neomutt/neomutt/issues
or send an email to: <[email protected]>
I'm submitting this bug report on behalf of Marvin Renich who doesn't have a github account; please see http://bugs.debian.org/945442 for a full discussion of the bug, including his comments and the request to file this issue.
Duplicate #2002 and there's already pull request for it #2160.
Is it really a duplicate, though? I agree it's similar but it looked different to me (in #2002 the reported issue was, IIUC, that backspacing beyond the beginning of a prompt re-fills the prompt with the default text and teleports the cursor back to the end of the prompt).
You're right that the issue description is a little different. I wasn't able to reproduce the behaviour of #2002 But in the end it should be both resolved by #2160.
Proxying another message from Marvin, just for the record:
"Neomutt bug #2002 is about editing headers. This Debian bug and Neomutt #2161 are about commands in the message index. The behaviors are different in the two situations.
There are three behaviors being discussed:
In #2002, while editing headers, you currently get "new behavior". The bug reporter wants "old behavior" (what the previous version of Neomutt did in this situation). The patch adds a config option to select which you want.
In #2161, while in the message index, the previous version of Neomutt gave "old behavior". The current Neomutt gives "wrong behavior", _not_ "new behavior".
For example, type s and (assuming a save-hook matches for the message) the command line shows:
Save to mailbox ('?' for list): +some_folder
Now keep backspacing until +some_folder is gone and backspace one more time. Instead of aborting the save, the message is actually saved to +some_folder! This is really, _really_ wrong!
First, #2161 must be fixed so it doesn't give "wrong behavior". Then, the patch needs to be tested to see if it affects both editing message headers (#2002) and commands in the message index (#2161). If it does, great! If it doesn't, the patch should be updated so that it does.
Then, the default needs to be decided.
Holding the backspace key down is common practice for some people as a way of erasing the default prompt in preparation for typing a different value.
Both for this reason and to reduce surprise and change, I feel that the default should be "old behavior", but I can live with setting the option myself if other people would rather have "new behavior" as the default.
There is one more reason that having backspace remain on the command line instead of aborting is a better default. If someone has bound the backspace key to some action in the message index (or in the message editing screen), holding down the backspace key could invoke the bound action on one (or several) messages in the index, depending on how quickly the user releases the key."
Most helpful comment
Proxying another message from Marvin, just for the record:
"Neomutt bug #2002 is about editing headers. This Debian bug and Neomutt #2161 are about commands in the message index. The behaviors are different in the two situations.
There are three behaviors being discussed:
In #2002, while editing headers, you currently get "new behavior". The bug reporter wants "old behavior" (what the previous version of Neomutt did in this situation). The patch adds a config option to select which you want.
In #2161, while in the message index, the previous version of Neomutt gave "old behavior". The current Neomutt gives "wrong behavior", _not_ "new behavior".
For example, type s and (assuming a save-hook matches for the message) the command line shows:
Save to mailbox ('?' for list):
+some_folderNow keep backspacing until +some_folder is gone and backspace one more time. Instead of aborting the save, the message is actually saved to
+some_folder! This is really, _really_ wrong!First, #2161 must be fixed so it doesn't give "wrong behavior". Then, the patch needs to be tested to see if it affects both editing message headers (#2002) and commands in the message index (#2161). If it does, great! If it doesn't, the patch should be updated so that it does.
Then, the default needs to be decided.
Holding the backspace key down is common practice for some people as a way of erasing the default prompt in preparation for typing a different value.
Both for this reason and to reduce surprise and change, I feel that the default should be "old behavior", but I can live with setting the option myself if other people would rather have "new behavior" as the default.
There is one more reason that having backspace remain on the command line instead of aborting is a better default. If someone has bound the backspace key to some action in the message index (or in the message editing screen), holding down the backspace key could invoke the bound action on one (or several) messages in the index, depending on how quickly the user releases the key."