Commit Graph

184 Commits

Author SHA1 Message Date
Tomaz Canabrava
e71df623e4 Revert "Reflow lines when Terminal Shrinks"
Unfortunately the code is still fragile and I froze konsole
a few times in a few minutes. This is something that konsole
really needs, but we need more time to squish all the bugs
we find.
2020-12-31 11:45:53 +00:00
Tomaz Canabrava
dec1ad5d92 Revert "Fixed limits and Urls bugs"
This reverts commit 6d9c1d27a1.
2020-12-31 11:07:47 +00:00
Tomaz Canabrava
37218fe8f0 Revert "Reflow when executing an app"
This reverts commit 876a1752a1.
2020-12-31 11:07:30 +00:00
Carlos Alves
876a1752a1 Reflow when executing an app
The reflow need to guess where the cursor line is when the user change
the konsole window size while executing an app.
2020-12-31 10:52:56 +00:00
Carlos Alves
6d9c1d27a1 Fixed limits and Urls bugs
- Columns and lines limits fixed.
- Verify if it's needed to remove an URL after remove of _history lines.
2020-12-31 10:52:56 +00:00
Carlos Alves
4e10daa261 Fix visual glitches and performance
Some visual glitches with scroll position while changing screen size.
2020-12-31 10:52:56 +00:00
Carlos Alves
a9d5945500 Ident and wait 2020-12-31 10:52:56 +00:00
Carlos Alves
c6eed957df Fix _history limits and increase performance
There was a bug on _history limits, now it is fixed.
Increase the "_screenLines to _history when needed" performance
2020-12-31 10:52:56 +00:00
Carlos Alves
02ba277d0f Reflow current cursor bug
Calculate the current cursor position lines needed.
2020-12-31 10:52:56 +00:00
Carlos Alves
73ed15f215 Reflow from _history to _screenLine
Keep the current cursor position and have a better visual continuity
with _history lines.
2020-12-31 10:52:56 +00:00
Carlos Alves
a0719bbe68 Adjust minimal line and column
Reflow does not work when columns < 17 and/or lines < 3.
Seems to me there is a conflict of the window pixels size limit, the
columns that it can paint within those limits and the mouse position
when adjusting to the minimal window size.
2020-12-31 10:52:56 +00:00
Carlos Alves
14601a86a5 Reflow bug fixes
- Missing properties causing reflow bug.
- _screenLines[0].data() not working as I thoughit would.

TODO:
- Check the bug when columns around less than 25.
- Keep current line and take from _history to _screenLine.
- Check how and if it affects file history.
2020-12-31 10:52:56 +00:00
Carlos Alves
110b36a03a Missing to set property for the new line
It didn't crash or bug, but to be sure it won't.
2020-12-31 10:52:56 +00:00
Carlos Alves
6bf62a2ae1 Reflow the _history
Reflow the _history when the terminal resizes.
Reflow when a new text goes from _screenLine to _history.
2020-12-31 10:52:56 +00:00
Carlos Alves
6bcc306460 Join line when sending to history
Before adding new lines to history it will check if it is a warpped
line and join it.
2020-12-31 10:52:56 +00:00
Carlos Alves
155cedeca2 Keep the lines property
Instead of assign LINE_DEFAULT to next line, it will keep the current
line property.
2020-12-31 10:52:56 +00:00
Tomaz Canabrava
bccd0a3fcd Fix crash acessing wrong index 2020-12-31 10:52:56 +00:00
Carlos Alves
4d4d70d616 Ignore current cursor line
Don't need to reflow the current cursor line. (it will bug and crash)
2020-12-31 10:52:56 +00:00
Carlos Alves
2be00da524 Changed from 'NewLine' char to _lineProperties
_lineProperties is something that existed before. And in some Terminal
emulators it was used to wrap lines, I'm using it now to wrap lines
while resizing.
And improved the _history flux control when resizing.
2020-12-31 10:52:56 +00:00
Carlos Alves
284ed7aec2 _history management of _screenLines when resizing
Count the aditional lines that will be needed by the new size, if
more than 'new_lines', send to history.
2020-12-31 10:52:56 +00:00
Carlos Alves
ff0681d4c3 Change _screenLines to QVector
It was a fixed size array, as a QVector it will change size faster
without the need of memory allocation.
2020-12-31 10:52:56 +00:00
Carlos Alves
86a486934e Reflow lines when Terminal resizes: both ways
An attempt to resize on both ways: shrink and expand.

Still thinking on how to handle _history
2020-12-31 10:52:56 +00:00
Tomaz Canabrava
5cd00fd885 Reflow lines when Terminal Shrinks
There are plenty of bugs here, this is a *serious* wip.
This is also the biggest feature that is missing from konsole for
years and years.

todo:
- Handle history
- Handle increase of columns in terminal size
- handle new lines
2020-12-31 10:52:56 +00:00
Carlos Alves
bc6517593a Screen cursor position calculation and safeguards
Some improvements in calculations and safeguards when changing
cursor position, using defined value in Vt102Emulation.cpp to
protect the integers.
Added cursor position tests to ScreenTest.
Vt102Emulation MAX_ARGUMENT calculation wasn't correct, it was
sending an argument bigger than max argument.
2020-12-27 17:43:04 +00:00
Carlos Alves
2d58ed0281 Revert 'Fix bold character color paint'
This reverts commit 270d6ea324

Need aditional tests.
2020-12-18 18:46:42 -03:00
Edwin Pujols
8de0e6c78e Screen: Remove superfluous guards.
The code commented with `nowrap!` has no use: `_cuX` and `_cuY` get
updated to this value on image resize. This code also appeared in
functions unrelated to horizontal wrapping.

I also took the liberty to update the conditions which determine whether
to use "default values". Before, the conditions only checked for zero
instead of (invalid) negative numbers (maybe a few Q_ASSERT's are
desired here?).
2020-12-18 17:29:08 +00:00
Gustavo Carneiro
200e910fbc Move decoders to a new library konsoledecoders. 2020-12-13 11:58:04 +00:00
Gustavo Carneiro
86baf22c01 Move ExtendedCharTable to characters library. 2020-12-13 11:58:04 +00:00
Gustavo Carneiro
047449b471 ExtendedCharTable: Remove konsoleprivate dependencies. 2020-12-13 11:58:04 +00:00
Gustavo Carneiro
3afa3482b6 Move PlainTextDecoder to decoders folder. 2020-12-13 11:58:04 +00:00
Gustavo Carneiro
61f7ce0f0c Move HTMLDecoder class to a new folder decoders. 2020-12-13 11:58:04 +00:00
Carlos Alves
270d6ea324 Fix bold character color paint
Konsole was painting 'bold' character as 'faint bold' character.

BUG: 405345
FIXED-IN: 20.12
2020-12-01 03:19:06 +00:00
Kurt Hindenburg
0f656a32ff Remove 'This file is part of' comment lines 2020-11-12 22:35:45 -05:00
Kurt Hindenburg
78a0092522 Convert src to use SPDX license/copyright
https://community.kde.org/Policies/Licensing_Policy#SPDX_Statements
https://community.kde.org/Guidelines_and_HOWTOs/Licensing
2020-11-12 22:17:06 -05:00
Carlos Alves
2285d4ecc5 Fix a memory leak in class Screen 2020-10-10 08:07:47 -03:00
Martin T. H. Sandsmark
2c1ec710df fix moving overlapping lines 2020-10-04 02:17:47 +00:00
Martin T. H. Sandsmark
b6a945e4c9 improve performance of Konsole::Screen::moveImage with more than 2x. 2020-09-18 17:53:27 +00:00
Tomaz Canabrava
faceafcc68 Extract URL from a Escape Sequence and provide a HotSpot for activation
This path adds a new feature for konsole, in the form of URL Escaped
Sequences. It allows programs to embbed URL's on texts much like
the anchor tag in html does

There's a allowed list of possible schemas for links, by default
it only accepts http://, https:// and file:// but the user can
add more if he wants.

The maximum amount of URL's accepted is 200, to prevent OOM

History is taken into account while scrooling
2020-08-12 08:20:58 +00:00
Gustavo Carneiro
9f71cc38f3 Move PlainTextDecode and HTMLDecoder Classes to a new files. 2020-07-28 12:16:59 +00:00
Tomaz Canabrava
0478529c6f Move Profile related classes to it's own folder
This also allowed me to remove a few includes of Profile.h
around the codebase, that used Profile::Ptr. now the compilation
is a bit faster and also does not recompile things as often.
2020-07-27 19:14:53 +02:00
Gustavo Carneiro
fdad2645f1 Move History files to a new folder. 2020-07-22 00:00:33 -03:00
Gustavo Carneiro
616db49e69 Remove unused History.h and History.cpp files." 2020-07-21 23:47:34 -03:00
Kurt Hindenburg
9af85cd2ea Fix integer literal suffix 'u' is not upper-case 2020-07-15 23:53:09 -04:00
Luis Alves
66c830484c Add new ANSI sequences CNL and CPL
- It implements Cursor Next Line (CNL) sequence.
- It implments Cursor Previous Line (CPL) sequence.
- Ex: echo -e "Hello\e[3EWorld" or echo -e "Hello\e[3FWorld"

BUG: 418519
FIXED-IN: 20.08

https://invent.kde.org/utilities/konsole/-/merge_requests/116
2020-07-04 17:12:29 -03:00
Lukasz Kotula
b5d02842fc Fix for a crash caused by buffer-overflow in case of '>=1024' columns
'Konsole::Screen` defined an array of 1024 elements, where user
may resize the konsole to have more columns than this array can handle.
Selecting a row in such case, is going to cause a buffer-overflow.

Bug: 330066
2020-06-19 23:27:32 +00:00
Tomaz Canabrava
56ffdbbb29 Correctly handle selection and opening via clicks
Before we opened a link via mousePress but if we want to make a
selection that will open a file and drag.

Now we check if there is a selection before trying to open something.
So if you click and drag a url, it will not open. If you directly
click and release without dragging, it will open.

FIXED-IN: 20.08

https://invent.kde.org/utilities/konsole/-/merge_requests/9
2020-06-05 22:44:32 -04:00
Kurt Hindenburg
ab0636de8a Q_UNUSED() does not need semi-colon at end 2020-03-28 14:06:25 -04:00
Kurt Hindenburg
180a366d97 Add comment for reference 2020-01-01 17:05:52 -05:00
Kurt Hindenburg
259a11c9f5 Remove unused method writeSelectionToStream 2019-12-22 21:58:13 -05:00
Mariusz Glebocki
ce2029ed75 Keep empty lines when "trim leading spaces" is enabled
BUG: 412479
2019-10-05 19:13:46 +02:00