Summary:
Any process that is called in foreground with sudo (ex: sudo qtcreator) is identified by ProcessInfo::name only with the word sudo, being unable to identify which process it is. This fix makes it shows sudo along with the name of the process called.
Reviewers: #konsole, hindenburg
Reviewed by: #konsole, hindenburg
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12754
Summary:
Fixed cases mainly come from the fact that ScreenWindow can be
larger that TerminalDisplay's image, and the way how selection area is
bounded (character's left edge, not first/last character in selection).
Test Plan:
* Compile with ASAN
* Turn on blinking cursor
* Slowly change window size to less than 1 line or less than 1 column
* If everything is still ok, run `top` or anything that generates longer
output
Expected result: no overflows
* Random selections (normal/block/line/word):
* on screen in left/right direction
* on screen + in history
* selecting history up
* selecting history down
* first/last character → last/first character in the line
* first/last character → last/first character on the screen
* all above with wide characters
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12551
Summary:
Move the Q_DECLARE_OPERATORS_FOR_FLAGS macro declaration for the
DecodingOption enum to the Konsole namespace. This should fix a bug that
happens when KeyboardTranslator.h is included in Screen.h (either
directly or indirectly), where the compiler doesn't find the |() operator
of the QFlags class.
I haven't pinpointed where the conflicting |() operator is coming from
exactly, but moving the macro declaration to the Konsole namespace
matches how other QFlags are used through out the code (and matches
upstream doc examples).
Test Plan:
- Add this include to Screen.h and try to compile:
#include "KeyboardTranslator.h"
- The compilation fails in SessionController.cpp:
error: invalid conversion from 'int' to 'Konsole::Screen::DecodingOption'
The line it fails on is 1200:
QString selectedText = _view->screenWindow()->selectedText(Screen::PreserveLineBreaks | Screen::TrimLeadingWhitespace | Screen::TrimTrailingWhitespace);
- Apply the diff and build again, the build should complete
I tested the options from the DecodingOption enum from the Screen class and they still work as before
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12797
Summary:
Prepend a 0 to the VERSION_MICRO part of the KONSOLE_VERSION string
to make the env var length consistent, so that conditions that depend
on it actually work.
For example, the second version should be higher than the first one:
18.04.12 -> 180412
18.08.1 -> 180801
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12733
Summary:
Before this commit when Konsole was trying to render a character that
didn't exist in the font selected by user, it'd fall back to default font provided
by font config without any hints that it needs monospace fonts which usually
would be a sans font.
Now Konsole hints system that it needs a monospace font.
BUG: 393620
Reviewers: hindenburg
Reviewed By: hindenburg
Subscribers: #konsole, hindenburg, mglb, ahmadsamir
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12614
Summary: {F5822474}
Test Plan:
* Turn on IME (tested with ibus+anthy)
* Type (without accepting) long text using IME
Expected result: text should not be drawn outside terminal
Actual result: text is drawn on terminal, margins, scrollbar
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12556
Summary:
The env var is exported as a numeric string (by removing the dots from
the version string), this has the benefit of making it simpler to compare
the version in shell arithmetic expressions.
This should help programms like neovim check if konsole has support
for terminal capabilities (e.g. DECSCUSR) by using a condition that
checks the konsole version. See also:
https://github.com/neovim/neovim/issues/8300
CCBUG: 347323
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12621
Summary:
When mouse pointer is mapped to character position, the algorithm
rounds the position to the nearest left edge of a character. This makes
sense for selections, but not for hotspots like links, where "character
under the pointer" is better solution. This patch adds edge mode as an
option to `getCharacterPosition` and disables it for hotspots.
Test Plan:
* Turn on "Underline links" option (Profile options → Mouse)
* Increase font size in Konsole so it will be easy to move mouse pointer
above left or right half of the character
* Run: `echo -e 'www.kde.org\033[31;41m \033[0m'`
* Place pointer on the right half of the 'g' character
Expected result: underline should have the same color as the link
Actual result: underline uses color from the next character on the right
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12555
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:
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