Commit Graph

7798 Commits

Author SHA1 Message Date
Aleix Pol
045c1db103 Offer input hints for the widget
We don't want input methods to insert a capital letter to start or to
offer predictions as they'll be misleading.
2021-05-21 20:46:37 +02:00
Ahmad Samir
e03a468075 Don't override profile icon in "New Tab" menu
We only need to set the favourite emblem for the default profile icon, for
other profiles, the profile icon is already set on the menu action.

Rename a lambda to a more meaningful name.

BUG: 437200
FIXED-IN: 21.08
2021-05-16 15:24:36 +02:00
Heiko Becker
110d705f8a GIT_SILENT Update Appstream for new release
(cherry picked from commit 2680966ad1)
2021-05-07 20:17:16 +02:00
Alexander Lohnau
d54a1718a4 GIT_SILENT Add auto generated files to .gitignore 2021-05-06 09:27:42 +02:00
Carlos Alves
7b2a751b30 Fix Screen::_cuY position inside screen
Keep _cuY position inside max screen lines in AppScreen mode.
2021-05-05 14:11:34 +00:00
Luis Javier Merino Morán
0ecc366c02 Fix crash on resize while doing other things
Commits 9ffe33a27a and
4352df00d9 introduce and use a
getScreenLineColumns(line) method to provide support for DECDWL
(Double-Width) lines.

It turns out that under some conditions on resize Screen::_cuY (the
current cursor Y position) and ScreenWindow::endWindowLine() can have
different ideas of how many lines the terminal has.

A test that asserts:

 - while [ true ]; do echo -e "\e[?1047h";  done
 - Resize the window, making it smaller

BUG: 436327
2021-05-05 14:00:23 +00:00
Luis Javier Merino Morán
d5b290aa48 Fix potential crash in Screen::restoreCursor
Restore Y coordinate before X coordinate, so we make sure Y is in bounds
before trying to access _lineProperties depending on Y.

To test:

 - Go to the last line
 - tput sc
 - Shrink the terminal
 - tput rc
2021-05-05 14:00:23 +00:00
Carlos Alves
e245610e87 Optimize CompactHistoryScroll remove lines
* Using internal erase function instead of While loop.
* Just clear if there is only one line.
2021-05-03 19:39:47 +00:00
Carlos Alves
c531887b6f Change HistoryScroll contantness
Declaring it where there is no change in content and enable compiler to
perform better optimizations.
2021-05-03 19:39:47 +00:00
Carlos Alves
2aa61bb994 Change CompactHistory data storage
It is removing the vector of lines storage. Now it is using a similar
idea used in history file.

All chars are stored in a linear way, only the line indexes are
changed when reflowing.

No speed problem found when removing lines.
2021-05-03 19:39:47 +00:00
Friedrich W. H. Kossebau
92798b03bc Port away from ECMSetupVersion's deprecated *_VERSION_STRING CMake variable
GIT_SILENT
2021-05-03 02:24:13 +02:00
Carlos Alves
49692c0f14 Fix crash showing Settings Dialog
When you open settings and close it, than open a new window, than
close the old window, the MainWindow with the settings will
delete the configDialog. If you try to open settings againg it crashes.

Fix is each MainWindow now has its own configDialog.

BUG: 436366
2021-05-01 13:02:28 -03:00
Kurt Hindenburg
242213afd9 Add missing include to fix build on gcc-11 2021-04-30 17:07:13 -04:00
Alexander Lohnau
7373f3b83c Convert MIT licensed files to SPDX 2021-04-29 18:50:13 +00:00
Carlos Alves
1684952d34 Make CompactHistoryBlock size variable
When needed CompactHistoryBlock can now increase from 256kb to a bigger
size.

BUG: 436031
2021-04-28 09:34:48 -03:00
Nicolas Fella
562f8e444f Port from KIconLoader::loadIcon to KIconUtils::addOverlay + QIcon::fromTheme
This fixes the rendering on highdpi screens
2021-04-27 01:12:26 +02:00
Jan Blackquill
9f7cb32dc2 Use inverted colours when calculated fancy BG has too low contrast
BUG: 435309
2021-04-26 13:33:55 +00:00
Yuri Chornoivan
fdf8cedaf2 Add docs about Konsole layouts 2021-04-25 16:36:54 +03:00
Lucas Biaggi
29e86ddeb7 Add ability to load/save session layouts(split views) and add default layouts
Add three layouts to the toolbar; add --layout <file> to the command line.
The 3 defaults layouts are 2x2, 2x1, 1x2

GUI:
2021-04-24 21:30:11 +00:00
l10n daemon script
22e7a1aa3d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-04-21 01:21:33 +00:00
Kurt Hindenburg
4227a7bccb Port away from from deprecated QPrinter::pageRect() 2021-04-17 16:00:05 -04:00
Kurt Hindenburg
bd3de37467 Add a TODO about Qt6 removing QFont::ForceIntegerMetrics 2021-04-17 14:27:54 -04:00
Kurt Hindenburg
68e9f474d1 Add comment in this file so it is in the generated file 2021-04-17 13:16:28 -04:00
Kurt Hindenburg
64dbb83d01 Port away from deprecated ::endl to Qt::endl 2021-04-17 13:15:50 -04:00
Kurt Hindenburg
70ffd75e24 Remove code for pre Qt 5.15.0 versions 2021-04-17 10:31:17 -04:00
Luis Javier Merino Morán
fd1612ba3b Keep track of line properties for image update
Konsole wasn't really keeping track of changes to line rendition
attributes, and was just always marking for update the top line of
double-height lines. This didn't account for double-width lines, changes
back to single-width single-height, and did not provide proper support for
separate rendering of the bottom of double-height lines.

The effect can be seen on vttest "Test of known bugs" (9) -> "Erase
right half of double-width lines" (8), where a line is changed from
single-width to double-width and back. The line wasn't re-rendered on
each change, as it should.

Can also be tested with:

echo -e "\e[2J\e[1;1HTEST\n"; sleep 1; echo -e "\e[1;1H\e#6\e[2;1H"
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
05d81656f2 Do not reflow double-height lines
Double height lines are actually two lines, the first with the top part
of the characters, the second with the bottom part. Reflowing could lead
to situations where we render a top part, a double height line with its
top and bottom parts, and a bottom part, which looks weird.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
3cd160f5a0 Prevent selecting beyond last column on double-width lines
There is a difference with xterm behavior: when the screen width is an
odd number of columns, xterm allows selecting up to columns/2+1, we just
allow selecting up to columns/2.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
9771b1d99d Make reflow aware of line rendition attributes
While DECDHL/DECDWL lines are not wrapped at the correct column, now at
least reflowing doesn't clear line rendition attributes, so resizing
Konsole and going back to the original size always recovers the original
content, including double-height/double-width status of each line.

Reflowing double-height lines doesn't make much sense, since a
double-height line actually consists of a top (T) and a bottom (B)
line. Shrinking them could lead to TTBB lines, which look weird. At
least now going back to the original size brings back the original
content in all its glory.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
57ce654da5 Support scrolling double-height/width lines
The scrollback buffer has support for a wrapped property for every line.
Extend it to support the line rendition attributes.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
c61e4cacb6 Allow writing only half of a double-height line
While DECHDL sequences should be used in pairs on adjacent lines, the
first line drawing the top half, and the second line drawing the bottom
half, apparently real VTxxx (or at least the VT220) terminals did draw
only the top or bottom of characters when confronted with an isolated
DECDHL line (https://retrocomputing.stackexchange.com/questions/18023/).
xterm has that same behavior. So behave likewise.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
2232ed6746 Fix selection on double width lines
TerminalDisplay::getCharacterPosition() should take double-width lines
into account to return the right column.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
e1e832f586 Don't clear line rendition on EL and partial ED
EL (Erase Line) should not reset the line rendition attribute to
single-width. ED (Erase Display) should only reset it for completely
cleared lines. ECH (Erase CHaracters) should obviously not reset it.
DECSED and DECSEL (Selective Erase, not supported by Konsole) should not
reset it.

This fixes a vttest test where a line is set to double-height-top and
then EL before writing its text and the double-height-bottom line below.

Can also be tested with:

echo -e "\e[2J\e[4;1HNormal\n\e#6DOUBLE\n\e#6DOUBLE\nNormal" &&
sleep 2; echo -e "\e[5;3H\e[1J\e[8;1H"
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
4352df00d9 Use the correct last column for double-width lines
Some control functions special case the last column. When a line has
been set to double-width via DECDWL or DECDHL (double-height and
double-width), the correcr last column for that line should be used.
Control functions which special case the last column include TAB, CUF,
ICH and DECRC.

Can be tested with:

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7l$r";
         $s="L"."\tx"x4 ."\t\tR"; say "\e#3$s\n\e#4$s"'

The above tests that tabs don't travel beyond the last column in
double-width lines.  The last column (below columns 79 and 80 of
the previous line) should have an "R".

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7h$r";
         $s="L"."X"x36 ."\e[6C"."R"; say "\e#3$s\n\e#4$s"'

The above tests that CUF (Cursor Forward) doesn't travel beyond the last
column in double-width lines.  The last column (below columns 79 and 80
of the previous line) should have an "R".

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7h$r";
         $s="L"."X"x22 ."R"."x"x8 ."r"."\e[17D\e[16@";
         say "\e#3$s\n\e#4$s"'

The above tests that ICH (Insert CHaracters; VT200+) doesn't write past
the last column, visible on repaints (switch to another window and
back).

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7h$r";
         $s="L"."X"x38 ."r\e7\e[H\e8R"; say "\e#3$s\n\e#4$s"'

The above tests that DECRC (Restore Cursor) doesn't restore the cursor
to a position beyond the last column on double-width lines.  The last
column should have an "R", "r" should not be visible.

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7l$r";
         $s="L"."X"x38 ."R"; print "\e#6$s"'; sleep 5; echo

The above tests that the cursor stays at the rightmost column. The
cursor should stay over the "R" for 5 seconds.
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
9ffe33a27a Fix appending characters at end of line in double width lines
Since double-width/double-height lines have room for just half the
characters, take that into account.

Can be tested with:

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7h$r";
         $s="L"."X"x38 ."RL"; say "\e#6$s"'

The above tests that appending characters to double-width lines in
DECAWM (Auto Wrap Mode) wraps at the correct last column. There should
appear a second line (single-width) with a single "L".

perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7l$r";
         $s="L"."X"x42 ." TEST FAILED OUTOFBOUNDS R"; say "\e#6$s"'

The above tests that appending characters to double-width lines in
non-DECAWM (Auto Wrap Mode) doesn't write past the last column (visible
on repaints - switch to another window and back). The last column (below
columns 79 and 80 of prev line) should have an "R".
2021-04-17 14:01:06 +00:00
Luis Javier Merino Morán
398a665793 Fix positioning of double width/double height runs
When there were several runs of double width/double height runs with
differing color/rendition/line draw/..., the second and subsequent runs
were positioned wrong. Fix the calculation of the starting x position to
account for double width, and fix a bug were the y position was
incremented for every run instead of for every line.

Can be tested with:
perl -E '$s="\e[0mTEST\e[32mTEST\e[0m"; say "\e#3$s\n\e#4$s"'
2021-04-17 14:01:06 +00:00
Kurt Hindenburg
559742f14b Require Qt 5.15.0 matching KF5 2021-04-16 10:11:23 -04:00
Ahmad Samir
053a07ca7a FileFilter: match filename:lineNumber in current dir 2021-04-16 13:54:17 +00:00
Heiko Becker
c66d1139c1 GIT_SILENT Update Appstream for new release
(cherry picked from commit f4fad3bbc7)
2021-04-14 17:06:30 +02:00
Laurent Montel
6d3cbbb2dc GIT_SILENT: not necessary to forward class when we already include file 2021-04-12 07:14:13 +02:00
Laurent Montel
e0e78c8659 Add cmake preset support 2021-04-12 07:13:07 +02:00
Ahmad Samir
c413d543c1 Fix QDialogButtonBox connections in the edit profile dialog
KPageDialog already creates the accepted()/rejected() connections, since
the code here created another connection, the accept() slot was being
called twice for each OK button click, with e.g. the profile name empty,
clicking Ok:
- the first time isProfileNameValid() would return false, and the saving
  would abort, as it should
- the second time around, isProfileNameValid() would return true since
  the name has been reverted to the original value in the Name line edit

The same goes for the reject() slot.

Also use a lambda instead of apply(), it's a very small method and this
was the code is more readable, since we don't need to jump back and forth.
2021-04-06 12:52:07 +02:00
Nate Graham
1c8db8a3fc Correct corrected string
It needed a few more tweaks to be fully consistent and gramatically
correct in English.
2021-04-05 08:27:50 -06:00
Nate Graham
a7efdb650f Correct gammar in "profile with this name already exists" message 2021-04-05 08:16:47 -06:00
Ahmad Samir
acd265efab Less delete calls in destructors
- If the QObject has a parent, the parent will take care of deleting it
- Use std::unique_ptr to manage pointer member variable
- Use '= default' with empty destructors
- Fix initialization of QTimer in constructor initialization list
2021-04-04 17:21:22 +00:00
Ahmad Samir
a7363fa53f Better management of member variables destruction in TerminalDisplay
Always pass a parent to a QObject constructor; this is always a good
idea, as it enforces the parent/child relationship, and it also means
the parent QObject will take care of deleting its children, less manual
'delete' calls.

_terminalPainter already has a TerminalDisplay parent object.

Use a std::unique_ptr to manage _printManager (it's not a QObject).
2021-04-04 15:33:05 +00:00
Ahmad Samir
46b56ecfa5 Use a KMessageWidget for profile-name related errors in the Edit dialog
A KMessageWidget is nicer than a modal dialog, and now we also
automatically switch to the General page when the user tries to save
the settings while there is an issue with the profile name.
2021-04-04 14:40:30 +00:00
Ahmad Samir
e805f086fe Change EditProfileDialog window title when creating a new profile
Now when creating a new profile, the title will be "Create new profile",
this is less confusing when the user tries to edit e.g. the Fallback profile,
which in effect will create a new profile as the Fallback one is immutable.
2021-04-04 14:40:30 +00:00
Tomaz Canabrava
ba81c56a5b Let the QObject hierarchy delete a QObject child
The terminalColor is a QWidget, created with the terminal display
as parent. if we are in the destructor that means that the
TerminalDisplay will delete this object when it's needed,
do not call delete directly.
2021-03-31 22:50:44 +00:00
Kai Uwe Broulik
c3982cfb12 Show display title in notifications
Makes it easier to identify the tab the notification came from, rather than
the usual "Session Default" or "Session Profile 1"
2021-03-31 19:49:52 +00:00