[Konsole-devel] [konsole] [Bug 196998] Konsole should reflow the text when resizing

Shawn Rutledge via KDE Bugzilla bugzilla_noreply at kde.org
Mon Jul 18 14:41:37 UTC 2016


https://bugs.kde.org/show_bug.cgi?id=196998

--- Comment #24 from Shawn Rutledge <s at ecloud.org> ---
What I would like is a checkbox to toggle between reflowing text, and having a
horizontal scrollbar.  In particular, qDebug messages are often quite long, and
usually some part of the line is the most interesting, so I'd rather be able to
scroll horizontally to that part.  Likewise, output from make: sometimes you
want to see all the options to gcc, sometimes you just want one line per file
that's being compiled.  I'd want to assign it a checkbox and then I'd probably
be toggling it back and forth fairly frequently.

The Windows command window is a lousy example in general, but it does have
horizontal scrolling, and the result that when running make, you get one line
per compilation, is quite useful.

If urxvt can wrap text in so little code, wrapping can't be that hard.  I often
use urxvt instead of konsole just for that feature, and for its speed and low
memory footprint... but then I miss the wonderful search and highlighting
features from konsole, mainly.

>From what I understand of terminals so far (from trying to understand and work
on yat), you need multiple text models.  The actual width is mainly important
in the mode that vi and ncurses-based programs use (but I forgot which escape
code switches "pages" or whatever they are called): such programs don't expect
or know how to deal with wrapping, and when you exit, you want the previous
text to be restored.  So that mode probably shouldn't be mixed with the usual
scrollable mode at all: it would even be OK to hide or disable the scrollbars
whenever you are running vi or an ncurses program, if that simplifies things. 
(Or, just save a snapshot of those lines into the main model, whenever you exit
from such a program.)  But otherwise, you can use a model (or a view, or
something between) which does know how to do the wrapping, and can either do it
optionally, or give you the whole unwrapped line length.  So I think that means
the model should be a set of lines, a line is composed of spans of text that
have the same attributes, and this wrapping-or-not would be taken care of at a
higher layer.  You don't wrap or truncate lines in the model itself, unless you
are in that single-page mode for ncurses or vi: then it can be a different
model which enforces its current size.  In that case when the window is
resized, there is some escape code which tells the program to re-output
everything, right?  Whereas in the usual mode which accommodates dynamic
wrapping, that refresh code doesn't seem to me to even be necessary.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list