1

On Linux, if I do a command with long output, for example dmesg and then edit a file with vim the screen is like after reset command.

On HP-UX, if I do a command with long output, for example dmesg and then edit a file with vim the screen is still filled with output of dmesg.

How to reset screen before edit with vim?

Let see,on linux,screen is occupied by vim,is that i want

enter image description here

On hpux,you will see part of dmesg output on screen

enter image description here

  • It's not clear to me what "reset screen before edit" means. Do you want to see the dmesg output again after vi exits, or ... ? – thrig Oct 7 '15 at 18:37
  • Sorry for unclear message,i will put two images for clear – elbarna Oct 7 '15 at 18:55
  • it looks a little bit like you've scrolled the HPUX window up a bit? – Jeff Schaller Oct 7 '15 at 19:02
  • Probably,but on linux i can scroll or run vim in console with 10000 lines of output,it reset the screen,very nice,how to do same thing on hpux?is 100% a vim settings. – elbarna Oct 7 '15 at 19:06
  • See also: stackoverflow.com/questions/5367068/… – AAAfarmclub Oct 6 '18 at 8:35
1

The screenshots in the question do not show dtterm (some people are confused by the ability to set the TERM environment variable to dtterm, xterm, etc., while using other programs, supposing that those other programs are identical to dtterm, xterm).

Here's a screenshot for instance from Oracle's documentation:

enter image description here

Given that, it is unclear what actual terminal was being used.

@jeff-schaller noticed the position of the scrollbar in the second screenshot and guessed that OP was expecting the terminal to skip down to the bottom of the scrolling area when typing into it. That is a feature of xterm and rxvt (and perhaps a few other terminals). From xterm's manual, there are resource settings:

scrollKey (class ScrollCond)
Specifies whether or not pressing a key should automatically cause the scrollbar to go to the bottom of the scrolling region. This corresponds to xterm's private mode 1011. The default is "false".

scrollTtyOutput (class ScrollCond)
Specifies whether or not output to the terminal should automatically cause the scrollbar to go to the bottom of the scrolling region. The default is "true".

as well as corresponding menu entries. The dtterm manual does not mention a similar feature.

On the other hand, the reset command will not by itself force the terminal to scroll to the bottom (except as a side-effect, e.g., from scrollTtyOutput).

0

The problem was my terminal, dtterm. Switching to xterm when using vim fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.