How to scroll back in Vim's built-in terminal?

650 views
Skip to first unread message

Redesorr

unread,
Oct 1, 2017, 1:25:12 PM10/1/17
to vim_use
Hello,
I am using Vim's built-in ":terminal", it works well.

However, I found it is impossible to scroll back in this terminal.

I have tried several terminal emulators and Gvim. But none of them can let me scroll back in terminal opened by ":terminal" command.

I tried SHIFT+PgUp and Ctrl+Shift+UP, both failed. And I don't find any information about scroll back in ":terminal" in Vim's document.

Is there any way to scroll text in Vim's ":terminal"?

Tony Mechelynck

unread,
Oct 1, 2017, 2:28:51 PM10/1/17
to vim...@googlegroups.com
I haven't much experimented with Vim's new +terminal feature, but I
remember how it was before, with the !something, :shell, etc.
commands.

In that case, Console Vim let you interact with the terminal it was
started from, with just something like "Hit Enter to continue" at the
end, but what you got (and IIUC still get) in gvim is a "dumb"
terminal, which emulates the kind of paper-hammer-ribbon
teletypewriter which could neither backspace nor move up the paper but
only move forward and down. So unless gvim's new +terminal feature is
radically different from what it used to run shells in before
+terminal came around, the answer to your question could quite well be
"In gvim there isn't, and in Console Vim you get what you started Vim
from".

Best regards,
Tony.

Nikolay Aleksandrovich Pavlov

unread,
Oct 1, 2017, 2:40:07 PM10/1/17
to vim...@googlegroups.com
+terminal uses libvterm which is xterm-compliant to a great extent, it
has nothing to do with what was there previously. To scroll back one
just needs to exit to normal mode and scroll there using regular
scrolling commands, e.g. via `<C-\><C-n>`.

>
> Best regards,
> Tony.
>
> --
> --
> 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+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar

unread,
Oct 1, 2017, 2:57:18 PM10/1/17
to vim...@googlegroups.com, Redesorr
First go to Terminal-Normal mode with CTRL-W N. Now the terminal window
behaves (mostly) like a normal buffer, you can scroll back with CTRL-B
or jump to the start with "gg". As soon as you use an insert command
such as "i" or "a" it will go back to Terminal-Job mode.

--
hundred-and-one symptoms of being an internet addict:
243. You unsuccessfully try to download a pizza from www.dominos.com.

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

Redesorr

unread,
Oct 1, 2017, 3:42:44 PM10/1/17
to vim_use

Thanks very much.
I forgot mode switch.

Cesar Romani

unread,
Oct 2, 2017, 9:49:23 AM10/2/17
to vim...@googlegroups.com
On 01/10/2017 01:57 p.m., Bram Moolenaar wrote:
>
> Redesorr wrote:
>
>> I am using Vim's built-in ":terminal", it works well.
>>
>> However, I found it is impossible to scroll back in this terminal.
>>
>> I have tried several terminal emulators and Gvim. But none of them
>> can let me scroll back in terminal opened by ":terminal" command.
>>
>> I tried SHIFT+PgUp and Ctrl+Shift+UP, both failed. And I don't find
>> any information about scroll back in ":terminal" in Vim's document.
>>
>> Is there any way to scroll text in Vim's ":terminal"?
>
> First go to Terminal-Normal mode with CTRL-W N. Now the terminal
> window behaves (mostly) like a normal buffer, you can scroll back with
> CTRL-B or jump to the start with "gg". As soon as you use an insert
> command such as "i" or "a" it will go back to Terminal-Job mode.
>

But CTRL-W N opens a new window! Only CTRL-\ CTRL-N goes to
Terminal-Normal mode. I'm using gvim on Windows 7.

--
Cesar

Bram Moolenaar

unread,
Oct 2, 2017, 1:30:16 PM10/2/17
to vim...@googlegroups.com, Cesar Romani

Cesar Romani wrote:

> On 01/10/2017 01:57 p.m., Bram Moolenaar wrote:
> >
> > Redesorr wrote:
> >
> >> I am using Vim's built-in ":terminal", it works well.
> >>
> >> However, I found it is impossible to scroll back in this terminal.
> >>
> >> I have tried several terminal emulators and Gvim. But none of them
> >> can let me scroll back in terminal opened by ":terminal" command.
> >>
> >> I tried SHIFT+PgUp and Ctrl+Shift+UP, both failed. And I don't find
> >> any information about scroll back in ":terminal" in Vim's document.
> >>
> >> Is there any way to scroll text in Vim's ":terminal"?
> >
> > First go to Terminal-Normal mode with CTRL-W N. Now the terminal
> > window behaves (mostly) like a normal buffer, you can scroll back with
> > CTRL-B or jump to the start with "gg". As soon as you use an insert
> > command such as "i" or "a" it will go back to Terminal-Job mode.
> >
>
> Bmut CTRL-W N opens a new window! Only CTRL-\ CTRL-N goes to
> Terminal-Normal mode. I'm using gvim on Windows 7.

It works fine for me. Maybe you typed "n" instead of "N"?

--
hundred-and-one symptoms of being an internet addict:
246. You use up your free 1 Gbyte in two days.
Reply all
Reply to author
Forward
0 new messages