Tuesday, December 10, 2019

"Press ENTER" prompt when edit file with long path

Hello!

In an 80-column terminal, when I invoke vim on an existing empty file
with a name that is 56 'x' characters, it displays the following prompt
before I can edit the file:

----
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 0 lines, 0 characters

Press ENTER or type command to continue
----

How can I stop it from doing that?

NOTE: The file has to exist for it to do this. If it's a new file that
Vim will create, Vim does not show the prompt.

It seems that it's being triggered by the message Vim is writing about
the file when the length of the message Vim writes exceeds 80 columns.
For example, it does not display the prompt if the file name is 55 'x'
characters.

Environment:

* OS: macOS Catalina 10.15.1
* Vim: 8.1, patches 1-2400 (Installed via Homebrew)

I'm hitting this all the time throughout the day in at least two use
cases.

The first is when using Vim as the editor for my email client, NeoMutt.
NeoMutt creates a temporary file for a new message that I compose, and,
at least on macOS, that file path is pretty long. For example:

----
/private/var/folders/05/c2k7bj3x0vv6p85skhxq86zm0000gp/T/neomutt-mink-502-88191-4572282957772858142
----

So, before I can compose each message, I get that prompt and have to
press ENTER.

The other use case is when using Vim as the editor for Mercurial. When
I make a commit, Mercurial creates a temporary file for the commit
message, and it too is long. For example:

----
/private/var/folders/05/c2k7bj3x0vv6p85skhxq86zm0000gp/T/hg-editor-4xe_jotf.commit.hg.txt
----

So, before writing every commit message, I have to press ENTER.

To reproduce this issue, do the following in an 80-column terminal in a
Bourne-like shell:

----
$ x56=$(dd if=/dev/zero bs=1 count=56 | tr '\0' x)
$ touch $x56
$ vim -u NONE $x56
----

Thank you!

Lewis

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191210180735.6vraesgogpv5a3uj%40mink.imca.aps.anl.gov.

No comments: