FR: toggle line/word wrap for scrollback (like word wrap in text editors) #4753
Unanswered
jjt
asked this question in
Ideas and Issue Triage
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context: I want a true one-line jujutsu log in a narrow(ish) terminal without any wrapping at all, regardless of the content.
I discovered control chars that control the disabling and setting of auto margin:
\033[?7l
and\033[?7h
(or the more ergonomic way of emitting themtput rmam
/tput smam
). And I was able to achieve what I wanted:But this has some drawbacks:
jj log
, but doesn't work for everything.tput rmam; $CMD_HERE; tput smam
every time, or write a shell fn or aliases.tput rmam
and then enter more characters than fit on the screen. Then delete them. And watch previous lines get gobbled up.And then I had a thought:
I don't set word wrap on my editor but I can toggle it on when needed. Why should my terminal be any different?
Yes, I can use a pager. Yes, I can use
less -S
which allows horizontal scrolling. Problems with this approach:less -F
which automatically quitsless
if the content is less than one page tall, and adding-S
overrides-F
when one or more lines are longer than the number of columns, which makes sense since there's something to horizontally page to, so quitting on short-but-wide output defeats the purpose of-S
For more context, I'm on macOS 15.1, using ghostty and zsh.
Beta Was this translation helpful? Give feedback.
All reactions