PS2 prompt appears after quitting vim

46 views
Skip to first unread message

tooth pik

unread,
Dec 17, 2022, 8:31:03 AM12/17/22
to vim...@googlegroups.com
dunno if it's something i borked or vim has changed, but for the last day or so when i quit vim i'm at the PS2 prompt, not the PS1

hitting enter clears it back to the PS1 prompt BUT THAT'S AN EXTRA KEYSTROKE

i'm using a slightly borked opensuse (15.3), X11, KDE, bash shell

if i try to edit with nano when i quit i am at the PS1 prompt

it happens if i start vim --clean so i can't suspect my .vimrc

Bram Moolenaar

unread,
Dec 17, 2022, 10:03:44 AM12/17/22
to vim...@googlegroups.com, tooth pik
What do you mean with "PS2" and "PS1" prompt?

What terminal are you using and what is the value of 'term' ?

--
Veni, Vidi, Video -- I came, I saw, I taped what I saw.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

tooth pik

unread,
Dec 17, 2022, 12:47:59 PM12/17/22
to vim...@googlegroups.com
when i set PS1 to '$(date "+%H:%M") \w> ' in my ~/.bashrc i get a bash prompt with
current time of day when i hit enter, current PWD, a greater than sign, and a space

just enter "echo $PS1" to see how yours is set

echo $TERM returns xterm

in bash the PS2 prompt is for when you are inside some functioning process but it needs
input

Bram Moolenaar

unread,
Dec 17, 2022, 2:25:05 PM12/17/22
to vim...@googlegroups.com, tooth pik

> when i set PS1 to '$(date "+%H:%M") \w> ' in my ~/.bashrc i get a bash
> prompt with current time of day when i hit enter, current PWD, a
> greater than sign, and a space
>
> just enter "echo $PS1" to see how yours is set
>
> echo $TERM returns xterm
>
> in bash the PS2 prompt is for when you are inside some functioning
> process but it needs input

Aha, you are talking about bash.

I don't know how bash decides to show $PS2 and how Vim can cause that.
I also cannot reproduce the problem. Perhaps someone can look into it.

--
Computers are not intelligent. They only think they are.

tooth pik

unread,
Dec 22, 2022, 11:39:14 PM12/22/22
to vim...@googlegroups.com
it's still doing it, but "it" isn't what i thought it was

it's not the PS2 prompt being used, it's the parts of PS1 that have to be evaluated
are simply not being evaluated: the $(date '+%H:%M') and the \w

when my PS1 is "$(date '+%H:%M') /w > " what winds up showing is the "> "

so there appears to be an evaluation of PS1 being skipped...

Friedrich Romstedt

unread,
Dec 23, 2022, 8:24:36 AM12/23/22
to vim...@googlegroups.com
Am Fr., 23. Dez. 2022 um 05:39 Uhr schrieb tooth pik <toot...@gmail.com>:
>
> it's not the PS2 prompt being used, it's the parts of PS1 that have to be evaluated
> are simply not being evaluated: the $(date '+%H:%M') and the \w
>
> when my PS1 is "$(date '+%H:%M') /w > " what winds up showing is the "> "

For me, this PS1 (with ``\w``, not ``/w``) works just fine, i.e.,
after having said ``vim`` or ``vim x``, the PS1 is printed as expected
after having left vim.

Is the behaviour on your side the same with a more simple PS1? What's
the outcome of ``type vim``?

You can possibly investigate if it is actually PS2 or not by setting
PS2 to some different string (``export PS2="fancy> "`` or the like).
- F.
Reply all
Reply to author
Forward
0 new messages