printf '\033]2;aaa\033bbb' prints bbb
printf '\033]2;aaa\033\\bbb' prints bbb
printf '\033]2;aaa\033' prints nothing;
title is changed when next character is received.
printf '\033]2;aaa\033\\' prints nothing
printf '\033]2;aaa\007bbb' prints bbb
printf '\033]2;aaa\007\\bbb' prints \bbb
printf '\033]2;a\ra\na\033bbb' prints bbb
printf '\033]2;a\ra\na\033\\bbb' prints bbb
printf '\033]2;a\ra\na\007bbb' prints bbb
In each case the title is set to aaa
BUG: 231405
FIXED-IN: 19.12.0
Summary:
Alternate Scrolling shouldn't be reset when calling resetModes(), this
is to maintain the profile alternate scrolling property after reset()
is called, otherwise calling reset() (or clear scrollback and reset)
will always make alternate scrolling get disabled regardless of the
respective profile property.
Also this matches XTerm behavior.
BUG: 402461
Test Plan:
1 - Open a new tab and make sure the alternate scrolling profile property
is enabled
2 - Run less or any other application that uses the alternate screen,
scrolling with the mouse should work
3 - Quit the previous application and execute `reset`
4 - Repeat 2, notice that now scrolling doesn't work
After applying the patch, alternate scrolling mode is not changed after
calling reset.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, hindenburg
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D17781
Summary:
Session:setUserTitle() changes various attributes of the current
session/tab, not just the title; change the name from "Title" to
"sessionAttribute" as that's more representative of what the function
does. Propagate the change where appropriate throughout the code.
Remove Vt102Emulation::requestWindowAttribute(), as it's not used
anywhere.
Update a couple of links to Qt and XTerm documentation, respectively.
Test Plan:
Every thing should work as before, for example changing the window title:
- "Show window title on the titlebar" must be enabled
- unset PROMPT_COMMAND (in case it already sets the window title)
- Change the window title:
`printf "\033]2;%s\007" "testing"`
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13147
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:
Ignore control characters in the text part of Xpe (OSC, Operating System
Control) of the form "ESC]Pn;Pt\a" escape sequences; this matches what
XTerm docs say.
If userTitle is an empty string, set the window title to a blank space
when showWindowTitleOnTitleBar is enabled; basically if the user sets
the title to an empty string, leave it as-is.
BUG: 315581
FIXED-IN: 18.08
Test Plan:
- unset PROMPT_COMMAND, in case the shell is configured to set the
window title via that variable
- Make sure "Show window title on the title bar" is enabled
- Execute:
$ /usr/bin/echo -e 'j\e]2;\n\aj'
- The window title is changed to the tab title text; and the output
looks like this:
j
j
- Apply the diff, build, and try again, the window title should be
set to an empty string (really a blank space), and the output
should look like:
jj
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13078
Summary:
Add a few bytes to a small arrays on stack in order to make compiler
happy. Those warnings are invalid in this context (as long as terminal
width and height are not larger than 8-digits-long number).
BUG: 394565
Test Plan:
* Build Konsole with GCC 8 and `-Wformat-truncation` flag
Expected result: no format-truncation warnings
Actual result: three format-truncation warnings appear
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13080
Summary:
Currently Unicode uses 0x10FFFF code points. It is possible to represent
all of them with up to two 16 bit values (UTF-16), but this makes it
harder to e.g. check for their width.
Some test cases were changed. Originally they were added with an
assumption that the code point will be truncated to 16 bit value and
as a result changed to another code point.
Test Plan:
* All code points <= 0xFFFF should work as before
* Start the same tmux session in two Konsoles
* Change background to fully transparent in one of them and put it in
front of the other one, so that all text will overlap
* Generate characters with (you can pipe it to `fold -s | less -r`):
```
perl -XCSDL -e 'print map{chr($_), " "} 1..0xffff'
```
* Compare output visually.
* Code points > 0xFFFF should not be truncated to 16 bits
* "𝐀" and "퐀" should be different characters
* Some code points > 0xFFFF should have single width
* Vertical lines below should align:
```
|𝐀 |
|𠀋|
```
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: konsole-devel, hindenburg, #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D12236
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:
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:
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
Patch by btown using lxde/qtermwidget@60221da by @yan12125
ECMA-48 8.3.103 describes the sequence CSI Pn b for repeating the
previous character in the data stream. This sequence has been present
in XTerm since January 1997 and has been added to the latest terminfo
entry for xterm-new and derived entries such as xterm-256color.
https://phabricator.kde.org/D10064
Summary:
Would be ideal to process them too, but they seem kind of corner
case and ignoring them fixes vim having $q q written on the first
line on startup
BUGS: 383976
Test Plan:
Ran vim, looks good
Should this go to 17.08 or master?
Reviewers: hindenburg
Reviewed By: hindenburg
Subscribers: #konsole
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D7644
Use the correct decimal value 27
In bash, PS1="\e]0;<title>\e\\" or PS1="\e]0;<title>\033"
BUG: 231405
Differential Revision: https://phabricator.kde.org/D5576
Treat "\e]0;<title>\e\\" (set window title) the same way
it interprets "\e]0;<title>\007".
It seems that Konsole does not recognize the standard string terminator
sequence "\e\\" (ESC \). Everything works fine if I use "\007" (BEL).
<http://invisible-island.net/xterm/xterm.faq.html#how2_title>
Thanks to Aniketh Girish anikethgireesh gmail com and Martin Sandsmark
martin sandsmark kde org for patch/review
BUG:231405
REVIEW:129895
Adds faint intensity, strikeout, conceal and overline support.
echo -e 'D\e[2mD\e[9mD\e[53mD\e[8mD'
Thanks to Antonio Russo antonio e russo gmail com for patch
REVIEW: 128405
BUG: 362171
vim uses control sequence 'echo -e "\033]11;?\a"' to request real
background color -- to detect whether terminal has dark or light
background.
Thanks to Pavel Raiskup praiskup redhat com
REVIEW: 125333
BUG: 352945
FIXED-IN: 15.12
Qt5.4 appears to have caused this issue. Test using showkey, mc, emacs
Thanks to Chirag Anand anand chirag gmail com for fix
BUG: 341157
REVIEW: 122711