I want to do the same as the "top" command on exit:
Print something on the screen, then go to the bottom of the terminal window so that the tooltip is on the bottom line.
(If I just print 1000 blank lines, I will lose what I printed on the screen, so I need a more elegant solution to get to the bottom of the terminal window)
How to achieve this in bash?
tput cup $(tput lines) 0
, tput cup X Y X, Y ( .) tput lines tput li X . , tput li terminfo, , tput cup 1000 0 ( , tty 1000 !) - , , " ", , : clear; tput cup 5 0; printf hello; sleep 1; tput cup 5 0; printf world; tput el; tput cup $(tput li) 0
tput cup X Y
tput lines
tput li
tput cup 1000 0
clear; tput cup 5 0; printf hello; sleep 1; tput cup 5 0; printf world; tput el; tput cup $(tput li) 0
bash LINES COLUMNS, , .
:
echo -ne "\E[${LINES};0H"
ansi.
Source: https://habr.com/ru/post/1695984/More articles:Python / Kivy: selection bar in RecycleView using the Up and Down keys - python-2.7Как сделать всплывающее окно с изображениями на клике в формате datatable? - rИспользуйте AWK для поиска по файлу fasta, учитывая второй файл, содержащий имена последовательностей - awkRelated heatmap and sparkline tooltip - data-visualizationConvert an array of javascript object to array array - javascriptTriple operator behavior - pythonПравильно удалять дубликаты в списке - javaHow to make Serializable function in general - javaHow to implement TvView on Android TV? - javaIntegration of Spach Trident and Kafka Spout - javaAll Articles