开发者

Horizontal scroll in a bash window

开发者 https://www.devze.com 2022-12-18 07:06 出处:网络
I used printf to output a columnar display of a text file. However the length I wanted will cause the columns to flow into the next line.

I used printf to output a columnar display of a text file.

However the length I wanted will cause the columns to flow into the next line.

I've been sea开发者_开发技巧rching for a flag or workaround that will make the console window scroll and could only come across the following:

set horizontal-scroll-mode On

It's right under the #! /bin/bash line, but couldn't work

Is there another way?


No. Terminals are not designed to scroll horizontally. Use less -S to allow scrolling left and right as well as up and down.


Maybe you should look into using dialog, here's the man page for dialog, or ncurses to do this for you instead of wrestling with the means of outputting text and scrolling. Let those libraries take care of that for you.

Hope this helps, Best regards, Tom.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号