Quantcast

"Press ENTER or type command to continue" behavior is different between gvim and terminal vim

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

"Press ENTER or type command to continue" behavior is different between gvim and terminal vim

H Xu
Hello,

For the following vim script in a tmp.vim file:

        :!echo 1
        :!echo 2

When executing ":so tmp.vim" in a terminal vim (I'm on Konsole of KDE),
the output is like this:

        1

        Press ENTER or type command to continue
        2

        Press ENTER or type command to continue

But on gvim:

        :!echo 1
        1
        :!echo 2
        2

        Press ENTER or type command to continue

Note that on terminal vim, there are two "Press ENTER or type command to
continue", but on gvim there is only one.

Is there any solution to unify the behavior? I'm writing a vim script
and this difference could be annoying.

Thanks!

Hong

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

John Beckett-2
H Xu wrote:

> For the following vim script in a tmp.vim file:
> :!echo 1
> :!echo 2
>
> When executing ":so tmp.vim" in a terminal vim (I'm on
> Konsole of KDE), the output is like this:
>
> 1
>
> Press ENTER or type command to continue
> 2
>
> Press ENTER or type command to continue

This is probably related to 'cmdheight'. See:
http://vim.wikia.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts

John

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

John Little-4
On Thursday, March 22, 2012 8:55:47 PM UTC+13, JohnBeckett wrote:
>
> This is probably related to 'cmdheight'. See:
> http://vim.wikia.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts

How so?  cmdheight=1 in both cases.

Regards, John Little

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

John Beckett-2
John Little wrote:
>> This is probably related to 'cmdheight'.
>
> How so?  cmdheight=1 in both cases.

That was not mentioned by the OP, and while it's possible/likely
to be the case, I was guessing that the vim and the gvim might
have different configs.

John

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

H Xu
On 03/23/2012 02:21 PM, John Beckett wrote:
> John Little wrote:
>>> This is probably related to 'cmdheight'.
>>
>> How so?  cmdheight=1 in both cases.
>
> That was not mentioned by the OP, and while it's possible/likely
> to be the case, I was guessing that the vim and the gvim might
> have different configs.
>


Thanks for you answer.

I use "(g)vim -U NONE -u NONE" to start (g)vim, but the situation
remains the same.

Hong

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

Ben Schmidt
In reply to this post by H Xu
On 22/03/12 5:37 PM, H Xu wrote:

> Hello,
>
> For the following vim script in a tmp.vim file:
>
> :!echo 1
> :!echo 2
>
> When executing ":so tmp.vim" in a terminal vim (I'm on Konsole of KDE), the output
> is like this:
>
> 1
>
> Press ENTER or type command to continue
> 2
>
> Press ENTER or type command to continue
>
> But on gvim:
>
> :!echo 1
> 1
> :!echo 2
> 2
>
> Press ENTER or type command to continue
>
> Note that on terminal vim, there are two "Press ENTER or type command to
> continue", but on gvim there is only one.

I think this is because in terminal Vim, Vim doesn't know what's
happening during the commands, so it assumes each command has filled the
screen and stops for you after each one so you can at least see the tail
output of each. But in GVim, the output goes through GVim itself, so it
knows when the screen is full; it can display the more prompt as well as
the press enter prompt exactly as many times as needed to ensure you see
all the output.

> Is there any solution to unify the behavior? I'm writing a vim script
> and this difference could be annoying.

Do you need to see the output? If not, maybe :silent would help? It will
suppress the prompt altogether. (In my terminal Vim the screen is messed
up after doing this, though, and I need to issue :redraw to fix it up.)

If you do need the output, maybe you need to use a function that
captures the output or redirect it to a temporary file and read that,
and then display it the way you want it, rather than just using :! which
is simpler but not as flexible.

Ben.



--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "Press ENTER or type command to continue" behavior is different between gvim and terminal vim

H Xu
On 04/07/2012 09:07 AM, Ben Schmidt wrote:

> On 22/03/12 5:37 PM, H Xu wrote:
>> Hello,
>>
>> For the following vim script in a tmp.vim file:
>>
>> :!echo 1
>> :!echo 2
>>
>> When executing ":so tmp.vim" in a terminal vim (I'm on Konsole of
>> KDE), the output
>> is like this:
>>
>> 1
>>
>> Press ENTER or type command to continue
>> 2
>>
>> Press ENTER or type command to continue
>>
>> But on gvim:
>>
>> :!echo 1
>> 1
>> :!echo 2
>> 2
>>
>> Press ENTER or type command to continue
>>
>> Note that on terminal vim, there are two "Press ENTER or type command to
>> continue", but on gvim there is only one.
>
> I think this is because in terminal Vim, Vim doesn't know what's
> happening during the commands, so it assumes each command has filled the
> screen and stops for you after each one so you can at least see the tail
> output of each. But in GVim, the output goes through GVim itself, so it
> knows when the screen is full; it can display the more prompt as well as
> the press enter prompt exactly as many times as needed to ensure you see
> all the output.
>
>> Is there any solution to unify the behavior? I'm writing a vim script
>> and this difference could be annoying.
>
> Do you need to see the output? If not, maybe :silent would help? It will
> suppress the prompt altogether. (In my terminal Vim the screen is messed
> up after doing this, though, and I need to issue :redraw to fix it up.)
>
> If you do need the output, maybe you need to use a function that
> captures the output or redirect it to a temporary file and read that,
> and then display it the way you want it, rather than just using :! which
> is simpler but not as flexible.

Thanks. I'll try this.

Hong

--
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
Loading...