Tuesday, May 7, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 2407  / 2 Years ago, wed, march 16, 2022, 8:42:30

I have currently decided to test my double monitors in the vertical configuration, and I came across a problem that I had never had before: the input line on my terminal is too far down the screen!



I was wondering if there is a way to make the output scroll downwards, so that the input line stays at the top.



e.g., a normal terminal view looks like this:



PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=46 time=28.3 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=46 time=13.7 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=46 time=19.1 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=45 time=20.8 ms
64 bytes from 8.8.8.8: icmp_req=5 ttl=45 time=15.6 ms
64 bytes from 8.8.8.8: icmp_req=6 ttl=46 time=15.3 ms
64 bytes from 8.8.8.8: icmp_req=7 ttl=46 time=15.3 ms
64 bytes from 8.8.8.8: icmp_req=8 ttl=45 time=14.3 ms
64 bytes from 8.8.8.8: icmp_req=9 ttl=45 time=14.3 ms
64 bytes from 8.8.8.8: icmp_req=10 ttl=45 time=15.5 ms
64 bytes from 8.8.8.8: icmp_req=11 ttl=45 time=16.9 ms
64 bytes from 8.8.8.8: icmp_req=12 ttl=45 time=16.3 ms
64 bytes from 8.8.8.8: icmp_req=13 ttl=45 time=20.0 ms
^C
--- 8.8.8.8 ping statistics ---
13 packets transmitted, 13 received, 0% packet loss, time 12017ms
rtt min/avg/max/mdev = 13.773/17.391/28.343/3.812 ms
me@my_computer:~$


and instead I would like to have something like this:



me@my_computer:~$ 
rtt min/avg/max/mdev = 13.773/17.391/28.343/3.812 ms
13 packets transmitted, 13 received, 0% packet loss, time 12017ms
--- 8.8.8.8 ping statistics ---
^C
64 bytes from 8.8.8.8: icmp_req=13 ttl=45 time=20.0 ms
64 bytes from 8.8.8.8: icmp_req=12 ttl=45 time=16.3 ms
64 bytes from 8.8.8.8: icmp_req=11 ttl=45 time=16.9 ms
64 bytes from 8.8.8.8: icmp_req=10 ttl=45 time=15.5 ms
64 bytes from 8.8.8.8: icmp_req=9 ttl=45 time=14.3 ms
64 bytes from 8.8.8.8: icmp_req=8 ttl=45 time=14.3 ms
64 bytes from 8.8.8.8: icmp_req=7 ttl=46 time=15.3 ms
64 bytes from 8.8.8.8: icmp_req=6 ttl=46 time=15.3 ms
64 bytes from 8.8.8.8: icmp_req=5 ttl=45 time=15.6 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=45 time=20.8 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=46 time=19.1 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=46 time=13.7 ms
64 bytes from 8.8.8.8: icmp_req=1 ttl=46 time=28.3 ms
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.


I could not find any such documentation or question on the forums. If anyone has an idea, please let me know! (also if you think it's not possible)



Thanks!



PS: I'm using Ubuntu 12.04


More From » command-line

 Answers
6

I found one nice tip from which you can start. You must to play with bash:




To set it up:



$ bash    # try this in a subshell since ^C seems to cause it to exit
$ f () { sed "1s/^/$(tput cup 0 0)/;s/^/$(tput il1)/"; }
$ PROMPT_COMMAND='tput cup 0 0;tput il1; echo'
$ exec > >(f)


Press enter one extra time and it's ready to try. Sometimes the output
and the prompt are out of order and there may be other weirdness, but
it's kind of an interesting thing to try.




Source: Reversed Terminal / Command line window.



See also:




[#26607] Thursday, March 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eballxeye

Total Points: 370
Total Questions: 91
Total Answers: 139

Location: Suriname
Member since Sat, Jan 1, 2022
2 Years ago
eballxeye questions
Sun, Jan 8, 23, 18:23, 1 Year ago
Sun, Sep 11, 22, 23:24, 2 Years ago
Tue, Dec 14, 21, 07:15, 2 Years ago
;