Summary:
When a user drags a file or folder onto the Konsole window, by far the
most common and likely thing they want to happen is for the path to
that item appear in the window. This is what virtually all other terminal
programs do by default. Konsole does not, and I suspect 99% of its
users do not know that this setting can be turned off, as I did not know
until I started digging through the code itself.
This patch makes the paste-as-text behavior happen by default for new
profiles. Super advanced users can re-enable the drag menu if they like it.
For most Konsole users, I think not having it presents vastly better
drag-and-drop usability and increases the speed of hybrid mouse+gui
operations. As such, I believe this is an important change for {T6831}.
I know changing defaults like this can be scary and controversial, but I
really do believe that the "paste as text" behavior is what 99% of drags
to konsole are intended for. It's not at all like Dolphin where a user may
reasonably want to copy or link instead of move.
FEATURE: 393523
FIXED-IN 18.08.0
Test Plan: Make a new user, open Konsole, drag a file or folder to the window; it's immediately pasted as text
Reviewers: #konsole, hindenburg, #vdg
Reviewed By: #konsole, hindenburg
Subscribers: abetts, hein, #plasma
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12529
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:
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
Summary:
This patch addresses the following points:
- Ignore most DBus methods
- Disable the following actions:
clear-history, clear-history-and-reset, edit-current-profile, switch-profile
adjust-history, send-signal, zmodem-upload, edit-rename (tab bar)
- Session updates all views correctly when readonly changes
{F5754353}
Test Plan:
- Actions do not show when locked
- DBus methods are ignored when locked
- Multiple views in one session get correctly updated
Reviewers: hindenburg, #konsole
Reviewed By: hindenburg, #konsole
Subscribers: ngraham, hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11341
Summary:
Include top margin in the rectangle's vertical position, so it will
be drawn in correct position when TerminalCenter is set and/or
TerminalMargin is larget than 0.
Preview:
{F5756612}
Test Plan:
- Run `konsole -p TerminalMargin=8`
- Display something
- Run search and search for something
- The blue rectangle should cover current result line
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11412
Summary:
When applying profile changes don't touch tab titles explicilty set by
the user (via the rename tab dialog); the same goes when previewing
color schemes.
Update the tab text only if the user actually changed the the tab title
fomart in the rename tab dialog.
BUG: 354403
FIXED-IN: 18.04
Test Plan:
- In a konsole window with 2 or more tabs, rename a tab using the
rename-tab dialog
- Open the Edit Profile dialog and change some settings and save, also
try previewing some color schemes; note that the tab title changes
are kept
- In the Edit Profile dialog, change the tab format on the Tabs page,
and apply; note that the tab title the was renamed by the user isn't
changed but the tab(s) whose name wasn't changed are affected by the
tab title format setting change
- Open the rename-tab dialog, don't change anything and click OK; now
konsole doesn't count that as a tab title change
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11363
Summary: It clutters the UI and can still be permanently enabled in settings if so desired.
Test Plan:
Konsole looks a lot cleaner out of the box now
{F5750441}
Reviewers: #vdg, mart, hindenburg
Reviewed By: hindenburg
Subscribers: ahmadsamir, romangg, ngraham, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11258
Summary:
Call setDefaultRendition() before switching to the alternate screen
Quitting vim after using a color scheme which sets the character
background color doesn't clear that attribute in the alternate screen.
This affects other programs which use the alternate screen when run
right after quitting vim, e.g. less.
This issue appears to only happen with certain graphics cards/drivers.
BUG: 328287
FIXED-IN: 18.04
Reviewers: hindenburg, #konsole
Reviewed By: hindenburg, #konsole
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11246