LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using vi, i'd like to be able to scroll back beyond invocation to see O/S work (https://www.linuxquestions.org/questions/linux-newbie-8/using-vi-id-like-to-be-able-to-scroll-back-beyond-invocation-to-see-o-s-work-898614/)

needsleep 08-21-2011 08:52 AM

using vi, i'd like to be able to scroll back beyond invocation to see O/S work
 
It seems to me I used to be able to (using HP-UX) run a vi session and be able to scroll back before invocation to see what I had been doing. Often this information pertains to my current vi session. Using CentOS, invoking vi replaces my current window and only exiting vi will restore it. I can also shell out of course. Is there a way to allow the screen to scroll back like the old HP sessions?

Thanks.

bmarx 08-21-2011 11:59 AM

Sounds like the command "screen" may be your answer.

needsleep 08-21-2011 09:51 PM

I didn't think so. I used to use screen to hold a terminal session while I drove home from the office, for example. Package Manager says screen allows me to have multiple logins on the same terminal. I don't think it will actually change the behavior of vi.

What I was looking for, in case my original post was not clear, is that when I vi a file, I start at line 1 of the file, and no matter how long I've been on this session, the vertical scroll bar turns to a solid bar, meaning that I'm at the top of the screen - there are no more lines or screens of data earlier than my vi screen. Now we both know that to get into vi, I must have at least logged in, right? So the former behavior that I seek, was to allow me to see, in this case, the login information and the invocation of vi itself. This is a trival example, but the more general is just as easy to see. Whenever I vi a file, I want to be able to scroll back as many pages before that as my buffer will hold. The vertical scroll bar is not solid, it stays almost the same size as when I first invoked vi.

chrism01 08-21-2011 10:59 PM

I know what you mean, but I can't get google to tell me what you are looking for; I know its do-able(??)
You could try here for a start http://www.computerhope.com/unix/uxterm.htm; might help

needsleep 08-22-2011 12:08 AM

Thanks, but I'm not using Xterm, I'm using gnome-terminal, but you've given me an idea to read the list of options for it.

needsleep 08-22-2011 12:21 AM

There are few options for gnome-terminal compared to X-term. I was able to shut off the bell, which was also bugging me, but I was not able to find an option for a screen scrollback option. I believe it wouldn't have worked for me anyway, because the scrollback works fine if I'm not in vi. It must have something to do with vi, which I will now look at in the man pages.

needsleep 08-22-2011 12:29 AM

Reporting that there are no options in gnome-terminal to alter the behaviour previously described. Thanks all for your thoughts.

rob.rice 08-22-2011 01:25 AM

go to a real virtual terminal instead of an emulated one with crtl+alt+F1 log in then try it

needsleep 08-22-2011 08:13 AM

Well, that's very interesting. I am now in a virtual terminal session. I ran vi on a text file while here, but same behavior is experienced. In fact, because I have no scrollback even when I'm not in vi, it's a slightly worse experience.

RTFMing the manual, I read this: "Generally, there is no reason to leave the default console (virtual console #6) for graphical (X-Window) installations unless you are attempting to diagnose installation problems."

Further, during startup, this explains what that 3 second option is to login, before X-Window starts up.

If you run the experiment, hitting CONTROL-ALT-F1 (Note: I'm using CentOS 5.6), to get back to X-Window, type CTRL-ALT-F7. I note that the speed with which I was magically transported to the virtual terminal suggested that I hadn't actually left my X-Window session, and I am grateful today that I found the way back (unsaved work!)

lithos 08-22-2011 08:34 AM

Well, I don't mean to offend you, but I'm using a win machine to access my servers with TeraTermPRO client software and it does scroll back from VI file (in my case VIM) an I can see all the buffer before editing file. (I hope it helps, if you try with some other client)

good luck...

szboardstretcher 08-22-2011 08:53 AM

Quote:

Originally Posted by needsleep (Post 4449303)
It seems to me I used to be able to (using HP-UX) run a vi session and be able to scroll back before invocation to see what I had been doing. Often this information pertains to my current vi session. Using CentOS, invoking vi replaces my current window and only exiting vi will restore it. I can also shell out of course. Is there a way to allow the screen to scroll back like the old HP sessions?

Thanks.

I have also noted this difference between HPUX and Centos. Not sure what causes it, but it is very annoying. In fact, in "terminator" which is an emulator, vi will lock me from having ANY scrollback at all until it is terminated. I wonder if there is a bug report, or "new feature" report out there explaining this difference.

needsleep 08-22-2011 09:02 AM

No offense taken. I'm actually using Win XP for these posts. My current thinking, now that you've reminded me of it, is that I need to use a terminal emulator, like Reflections (or your TeraTermPRO) to connect via telnet(?) to the Linux box. This is the actual environment that I, too, experienced this ability to scroll back during a vi session. So, yeah, I think you hit it on the head.

chrism01 08-22-2011 07:15 PM

This is a lateral thinking/comment, but using Putty to access xterm on Solaris (from Win XP), I can scroll back just fine.
HTH

needsleep 08-23-2011 12:58 AM

Great minds think alike, chrism01. I just downloaded Putty this afternoon. Yet to install. Thanks for the confirmation that I am on the right track.


All times are GMT -5. The time now is 01:07 PM.