Summary:
Remove TerminalDisplay::sessionIsPrimaryScreen(), and use Q_ASSERT
instead, where if _sessionController is actually a nullptr it means
the current konsole process is doomed anyway. Better catch such cases in
debug builds.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13271
Summary:
Previously the code enabled sending emulated up/down key press events to
the terminal only if the current screen is the alternate buffer. The
problem with this approach is that when detaching a tab/view, a new
TerminalDisplay is constructed and _isPrimaryScreen is initialized to
true even though the current screen in the detached tab is the alternate
one.
Since the Session is preserved when detaching a tab, move that bit of
code to Session, and query the Session about the currently used screen
buffer.
Test Plan:
Before:
- Open a window with two tabs, and in one of them execute `man man`
- Make sure "Enable Alternate screen buffer scrolling" is enabled in the
current profile, and that you can can scroll in the alternate buffer
- Detach the tab showing the manual page, now scrolling doesn't work in
the alternate buffer
With the patch applied, scrolling should work after detaching the tab.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13217
Summary:
Previously the logic was to set "usesMouse" (Emulation
MODE_Mouse100{0,1,2,3}) to false to indicate that the program running
in the terminal supports handling mouse events itself, i.e. the program
is interested in receiving Mouse Tracking events; or set to true otherwise.
Since this was confusing, use the inverse logic by replacing "usesMouse"
with "usesMouseTracking".
"usesMouseTracking" is set to true when the program running in the shell
indicates it's interested in receiving Mouse Tracking events. Or false
otherwise.
For example, vim indicates it's interested in receiving Mouse Tracking
evnets when using visual mouse mode:
http://vimdoc.sourceforge.net/htmldoc/intro.html#Normal
Mouse Tracking is an XTerm extension, for more information examine:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
Test Plan:
Before:
- Execute `printf '\e[?1003h'` to enable mouse tracking mode in konsole, now when you move the mouse events will be sent to the terminal when you move, click, drag the mouse
- Pressing and holding the Shift key should let the mouse act as normal
- Open a new tab or execute `printf 'e[?1003l'`, then open any file in vim, `:set mouse=a` then select some text with the mouse, note that VISUAL is displayed at the bottom of the window; right clicking _doesn't_ show the context menu as you'd expecte
- Pressing and holding the Shift key should let the mouse act as normal
Apply the diff, build, and try again, everything should work as before.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13134
Summary:
For debug builds, the function will fail when called with out of display
coordinates, allowing to spot addressing errors. For regular builds,
it will limit coordinates to valid area without triggering errors.
Depends on D12551
Test Plan: * Compiles, does not fail with use cases from previous commit
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12553
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:
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:
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:
`_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:
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:
D10935 introduced KMessageWidgets in TerminalDisplay for the "resume"
and "read-only" messages. This patch restores the default close button
and makes use of animateShow/animateHide. A nice plus is that I also
removed some code which has become obsolete AND that the messages
are now animated.
{F5749781}
Test Plan:
Show/hide works like before.
Also still works if readonly and suspended at the same time.
Detaching works.
Reviewers: ach, #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, ach, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11241
Summary:
Konsole sends up/down key press events for mouse scrolls for apps that
aren't interested in mouse events, such as less. Only do this when the
terminal is using the alternate screen.
Now scrolling up/down will be translated to up/down key presses only
when the terminal is using the alternate screen but scrolling in a terminal
using the primary screen will only scroll using the scrollbar, now it does
not cycle through the shell history.
Now the behavior matches xterm and and gnome-terminal.
BUG: 355106
FIXED-IN: 18.04
Reviewers: hindenburg
Reviewed By: hindenburg
Subscribers: rkflx, ngraham, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11146
Summary:
As discussed with VDG, color the scrollbar with the same colors as
the terminal color scheme itself. It looks way cleaner and modern
Test Plan: tested with several color schemes and several styles
Reviewers: #konsole, #vdg, hindenburg
Reviewed By: #konsole, #vdg, hindenburg
Subscribers: hindenburg, zzag, ngraham
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D11184
Summary:
Depends on D10862
Before:
{F5734372}
After:
{F5734369}
Read-only:
{F5734370}
Both:
{F5734371}
This also fixes the overlapped scrollbar (see first screenshot).
Test Plan: Tested before and after, behaviour is the same.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: herrold, hindenburg, ngraham
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D10935
The default behavior hasn't change. Toggling this off will cause all
copy/paste to be text only.
BUG: 387397
FIXED-IN: 18.04
Differential Revision: https://phabricator.kde.org/D10448
Konsole has builtin code to manually write out line characters. There
are certain reasons why this might not be desired. This adds a profile
option to use the fonts line characters. The default is as-is today
using the builtin code.
BUG: 364992
(cherry picked from commit a4de3feb16)
Konsole has builtin code to manually write out line characters. There
are certain reasons why this might not be desired. This adds a profile
option to use the fonts line characters. The default is as-is today
using the builtin code.
BUG: 364992
This should update filters less often, and also hopefully fix the issue
where underlined links get stuck while scrolling.
The idea is to not to do it on all mouse updates, only when needed on
mouse updates, and also not display the filters if they are out of date.
The only thing that should happen on screen changes now is setting the
_filterUpdateRequired variable to true, which leads to the filters not
being displayed until re-processed, which happens the next time the
mouse moves, unless I fucked something up.
REVIEW: 128393
(cherry picked from commit f3ce85b9ef)
This should update filters less often, and also hopefully fix the issue
where underlined links get stuck while scrolling.
The idea is to not to do it on all mouse updates, only when needed on
mouse updates, and also not display the filters if they are out of date.
The only thing that should happen on screen changes now is setting the
_filterUpdateRequired variable to true, which leads to the filters not
being displayed until re-processed, which happens the next time the
mouse moves, unless I fucked something up.
REVIEW: 128393
Implements a feature from e. g. good old Konqueror/KHTML, where you got
a number overlaid all links when pressing ctrl, and then you could press
ctrl+number to activate that link.
REVIEW: 128348
This patch allows the dnd menu to be disabled, making it possible to
drag and drop URLs as text by default.
Thanks to Peter Wu peter lekensteyn nl for patch
REVIEW: 124908
BUG: 304290
While Konsole's main scrollbar is handled by QtScrollBar and therefore
works as expected under Qt5, the other custom scroll wheel actions
available do not accumulate and handle the small scroll deltas provided.
This results in stuttery, uneven and unexpected responses to scrolling.
Accumulate and trigger events on thresholds. If pixel scroll values are
provided, utilize them when emulating mouseup/mousedown events (by
dividing by pixel font height).
Patch by Lindsay Roberts linds r gmail com
REVIEW: 124590
Select entire line from a shortcut.
Patch by Christian Couder chriscool@tuxfamily.org
BUG: 327395
FIXED-IN: 2.13
(cherry picked from commit 7cf548bea8)
This will allow selectLine() to be called outside of using the Enum::
SelectWholeLine and SelectForwardsFromCursor. If more Enums are added
this code will need adjusted.
CCBUG: 327395
(cherry picked from commit ce55487204)
Use a helper method selectLine() which is most of the
mouseTripleClickEvent(). Also, in preparation for upcoming patch to
allow selectLine per shortcut.
CCBUG: 327395
(cherry picked from commit c5beb59032)
Previously when using an image as the background, the opacity was
ignored. This patch corrects that.
Many thanks for patch to Wolfgang Brehm wolfgang brehm gmail com
BUG: 312843
FIXED-IN: 2.13
(cherry picked from commit 09ca63dbb6)