Summary:
Fix regression introduced by commit a565bc9 (Clip character drawing
to its own cell). When the first character in a text fragment is
classified as RTL, rest of the fragment is also considered to be RTL
and is passed to `drawText()` as one string. The rendering is not
perfect (especially when RTL and LTR characters are mixed), but it
works as before.
{F5830191}
BUG: 393644
Test Plan:
* Display example sentences using a program which prints text directly
to terminal (e.g. `echo`, `cat`):
```
حروف به هم پیوسته
کِیدیئی (به انگلیسی: KDE) پروژهای برای توسعه یک
میزکار آزاد و متن باز است.
```
* Display the sentences in Konsole built before
commit a565bc9733
* Compare visually
Reviewers: #konsole, sassanh, hindenburg
Reviewed By: #konsole, sassanh, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12655
Summary:
For the Profile::KeyBindings property, if it's set in the _tempProfile
then the user opened the edit key bindings dialog and clicked OK, and
could have add/removed a key bindings rule. Allow applying the settings
so that the current profile KeyBindings property is updated without
having to restart konsole or open a new tab.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12255
Summary:
In Session::getUrl() check that _foregroundProcessInfo is valid before
tyring to access its members.
I couldn't reproduce the crash from the BR, but it is logical to call
isValid() before accessing any ProcessInfo object members.
BUG: 391447
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12175
Summary:
This mimics the XTerm Alternate Scroll Mode 1007
The h (set), l (reset), s (save), r (restore) modes depend on the profile
setting Mouse->Enable Alternate Screen buffer scrolling.
Depends on D12139
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12140
Summary:
Rename README.KeyTab to README-KeyTab to prevent Konsole from trying to
load it as a keyboard translator file, and fix references to that file
name in other files.
Flesh out README-KeyTab and README.keyboard and reformat them.
Also copy the the original README-KeyTab to README-KeyTab-original,
just in case there's some concept that I misinterpretted/misunderstood.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12032
Summary:
Konsole sends up/down key press events to programs running in the shell
if they indicate they are not interested in mouse events. This adds a
profile property to toggle this behaviour.
BUG: 170582
FIXED-IN: 18.08
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12139
Summary:
Also mention the manual on the Keyboard tab in the Edit Profile Dialog
to make it more discoverable for users.
Sources used while writing this documentation:
- data/keyboard-layouts/README.KeyTab
- doc/user/README.keyboard
- https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
- https://www.vt100.net/docs/vt100-ug
Reviewers: #konsole, hindenburg, yurchor, ltoscano
Reviewed By: #konsole, hindenburg
Subscribers: kde-doc-english, hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12015
Summary:
`_preserveLineBreaks` was set/reset only in mousePressEvent, and was
initially disabled. This led to use of the last setting from mouse
selection, or initial value, by "Select All".
BUG: 352616
Test Plan:
* Start Konsole
* Run `seq 100`
* (optional, test should give the same effect with and without this step)
Press {key Ctrl} and select some text
* Edit → Select All
* Copy
* Paste in any text editor
**Expected result:** text should be in multiple lines (like on
Konsole screen)
**Actual result:** text is pasted as one line
=== Regression tests ===
* Run `seq 100`
* Select few lines using mouse
* Copy
* Paste in any text editor
**Expected result:** text should be in multiple lines (like on
Konsole screen)
* Run `seq 100`
* Press {key Ctrl} and select few lines using mouse
* Copy
* Paste in any text editor
**Expected result:** text should be pasted as one line
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12058
Summary:
The lines are resized when something is put in them. Resizing them
here filled them with spaces (default value), later those trailing
spaces were put into history, and eventually into saved output or
clipboard (because it is assumed lines in history do not contain
trailing spaces).
BUG: 392419
Test Plan:
* Enable "Trim trailing spaces" in Profile Settings → Mouse
* Set window size to about 100x100px
* Clear terminal (Ctrl-Shift-K by default)
* Run:
```
seq $(( $(tput lines) * 2 )); \
printf '*** resize ***'; read -s; printf '\n'; \
seq $(( $(tput lines) * 2 ))
```
* When "resize" show up, resize the window to about 500x500px
* Press enter
* Select and copy lines below `*** resize ***`
* Paste it in a text editor which allows to show trailing spaces
Expected result: lines should not contain trailing spaces
Actual result: lines added when resizing the window have trailing spaces
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11893
Summary:
To calculate string width, Konsole uses character cell widths.
Rendering engine uses actual characters widths for this purpose.
Those sizes are equal in fixed-width fonts, as long as the font
has specific character. Since no font contains all Unicode characters,
some of them are taken from different fonts and their sizes differ
from their cell size. This can lead to different results depending
on how text line is split into strings.
It can be assumed that characters in Basic Latin block in every
fixed-width font are really fixed-width, and can be rendered as one
string. All other characters are rendered separately, and their
rendering surface is limited to their cell.
Before/After screenshots:
{F5749612}
BUG: 361547
Test Plan:
Paste this: `⸻test` in konsole and highlight different parts of the string
In a text editor paste this:
```
| A |
| ⸻ |
| ⟹ |
| ⧠ |
```
and move cursor vertically through characters column
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, ngraham, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11237
Summary:
In D11184 a visual glitch was introduced when using transparent
background in Konsole.
BUG: 391788
FIXED-IN: 18.04
Test Plan:
**Before:**
Opaque, there was no problem here
{F5779911}
Transparent, obvious problem
{F5779912}
**After:**
Opaque, nothing changes here
{F5779913}
Transparent, problem fixed
{F5779914}
Reviewers: hindenburg, #konsole
Reviewed By: hindenburg, #konsole
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11839
Summary:
After the KNewStuff changes that were added to
EditProfileDialog::removeColorScheme(), now when
resetColorScheme() calls removeColorScheme() Konsole crashes.
Change resetColorScheme() to call ColorSchemeManager::deleteColorScheme()
directly; this is more logical since there's no need to delete the row
from the color schemes list as reseting the color scheme just deletes
the relevant color scheme from the user's home dir and "re-adds" the
original one from the system-wide location.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11821
Summary:
* Do not send mouse events and emulated up/down keys to programs when
read-only mode is enabled.
* Set the currentTerminalDisplay before sending key events, like in
keyPressEvent.
* wheelEvent code is restructured a bit to easily separate code not
allowed in read-only mode.
Test Plan:
* Start Konsole
* Run `man man`, do not press any key after enter
* Turn on read only mode
* Try to scroll using mouse wheel.
* Expected result: scrolling does not work in read-only mode
* Actual result: scrolling works in read only mode (but only when no key
has been pressed before on 2nd terminal screen)
* Start konsole
* Run a program which uses mouse events, e.g. `vim`
(enable mouse with `:set mouse=a`)
* Make the program state suitable for using mouse events, e.g. enter a few
lines of text
* Confirm that mouse events (clicks, selection, wheel) work in the program
* Turn on read-only mode
* Try:
* Click (left/right/middle button), double click
* Mouse wheel
* Click and move (selecting)
* Expected result: mouse events are not passed to the program in read-only
mode; nothing happens
* Actual result: mouse events are passed to the program
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11763
Summary:
There are (more or less) valid cases when currentTerminalDisplay can be
not set:
* konsole started with `--background-mode`, `sendText` called via D-Bus
* text send through KPart's `sendInput()`
It can be assumed read-only is not set in this case.
This patch should also fix TerminalInterfaceTest. Currently the shell
probably doesn't get commands send through sendInput.
Test Plan:
* Run `konsole --background-mode --nofork & ; sleep 2; qdbus org.kde.konsole-$! /Sessions/1 sendText $'echo test\n'`
* Press Ctrl+Shift+F12
* The terminal should show `echo test` command and its result
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11762
Summary:
Allow to use scrolling (Shift+Up/Down/PgUp/PgDown/Home/End) and a key
for showing URL hints when the view is in read-only mode.
Test Plan:
* Prepare
* Turn on scrollback
* Set at least one modifier key for "Show URL hints" (edit profile → advanced)
* Generate a few screens of text in Konsole
* Display some URL (e.g. `echo 'www.kde.org'`)
* Display current time every second: `while sleep 1; do printf '\r%s' "$(date)"; done`
* Turn on read-only mode
* Patch tests
* Hold down URL hint key - the URL should be underlined with square and a digit on the left
* Press <URL-hint-key>+1 - the URL should open in a web browser
* Scroll the view with Shift+Up/Down/PgUp/PgDown/Home/End - the view should scroll
* Split the view, do previous test in each split - only currently active split should scroll
* Regressions tests
* Press different keys (including Ctrl+C, Ctrl+Z, etc; skip those mapped to Konsole actions) - nothing in terminal should happen
* Press Ctrl+S - the time should not stop updating
* Use IME to enter text - nothing in terminal should be shown
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11668
This reverts the Ctrl+S/Q/C not sending to a read-only/locked session.
This portion is causing tests to fail on ASAN; which might be the tests
fault, but for now revert.
Summary:
Allow to use scrolling (Shift+Up/Down/PgUp/PgDown/Home/End) and a key
for showing URL hints when the view is in read-only mode.
Test Plan:
* Prepare
* Turn on scrollback
* Set at least one modifier key for "Show URL hints" (edit profile → advanced)
* Generate a few screens of text in Konsole
* Display some URL (e.g. `echo 'www.kde.org'`)
* Display current time every second: `while sleep 1; do printf '\r%s' "$(date)"; done`
* Turn on read-only mode
* Patch tests
* Scroll the view with Shift+Up/Down/PgUp/PgDown/Home/End - the view should scroll
* Hold down URL hint key - the URL should be underlined with square and a digit on the left
* Press <URL-hint-key>+1 - the URL should open in a web browser
* Regressions tests
* Press different keys (including Ctrl+C, Ctrl+Z, etc; skip those mapped to Konsole actions) - nothing in terminal should happen
* Press Ctrl+S - the time should not stop updating
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11668
Summary:
The first column in the key binding editor dialog usually has long lines of
text, to improve usability set a minimum size of 480x430 for that dialog
and an initial size of 500x500. Also set the initial width of that column
to 300.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: ngraham, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11637