Commit Graph

33 Commits

Author SHA1 Message Date
Luís Pereira eb17f3cc6b Merge branch 'issue640'
* issue640:
  Improve "Undecodable sequence" warnings
2021-02-23 11:13:30 +00:00
Chih-Hsuan Yen 71f8049760 Properly implement the "Action after paste" feature
Scroll to end only when data is not from pasting

Fixes https://github.com/lxqt/qterminal/issues/43
Fixes https://github.com/lxqt/qterminal/issues/741
2021-01-09 00:23:35 +08:00
Chih-Hsuan Yen 9a45a56f04 Improve "Undecodable sequence" warnings
Using Qt logging utilities instead of printf so that those warnings
can be enabled/disabled. Those warnings are disabled by default. To
enable them, use QT_LOGGING_RULES="qtermwidget.debug=true".

Also improve the formatting. An example warning:

Undecodable sequence: "\u001B[22;0;0t"

Closes https://github.com/lxqt/qterminal/issues/640
2020-12-26 16:54:52 +08:00
Yen Chi Hsuan c797ccf97d Handle keyboard commands properly
It was hard-coded in TerminalDisplay.cpp - Shift+Up always results in
ScrollLineUpCommand regardless of settings in *.keytab. Now those
commands are correctly parsed by KeyboardTranslator.

Fixes lxde/qterminal#348

This fix is similar to KDE/konsole@b88dfb402a
while I use signals and slots instead of introducing new pointers. That
sounds more reliable :)
2020-07-18 10:37:28 +08:00
Luís Pereira 91c5c2a48d Don't use 0/nullptr to initialize QFlags
It's deprecated.
2020-06-19 22:17:25 +08:00
Luís Pereira 6f72d9abad Fix calling signal without the emit keyword
A signal should always be emitted using emit/Q_EMIT.
2020-06-10 20:08:10 +08:00
Chih-Hsuan Yen e7feed379f Fix QCharRef deprecated behavior (closes #323)
Inspired by https://github.com/KDE/konsole/commit/324d78c07fc4fe2cdb2219a9e042a969df73d39c
2020-04-02 11:38:20 +08:00
Luís Pereira ab81290ea7 Avoid buffer overflows exploits
sprintf() perform unbounded operations. It allows a buffer overflow
exploit.
2020-02-22 18:22:44 +01:00
Chih-Hsuan Yen 0d9c8cf0b5 Colons support in RGB definition
With this patch, non-color sequences using colons are also accepted. I
consider such sequences undefined behavior, though.

Closes https://github.com/lxqt/qterminal/issues/78
2019-07-15 21:07:20 +02:00
Luís Pereira 2110583a39 Port towards C++ headers 2019-04-13 15:49:15 +02:00
Luís Pereira b8906f6b0c Port towards C++11 nullptr 2019-04-13 15:49:15 +02:00
Andrew Janke 5ce909cbc2 Swap Qt::ControlModifier and Qt::MetaModifier on Mac
This is because their meaning is different there.
See https://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
2019-03-21 11:02:14 +08:00
Chih-Hsuan Yen ec25b71ea1 Fix handling of ST (String Terminator) for OSC (Operating System Commands)
This is an improvement over a combination of

https://github.com/KDE/konsole/commit/7a41b73b46d1f774e82eb64a8b66920e411ccd3c
https://github.com/KDE/konsole/commit/d547d1d177bd0582df95a5d50dc3b37e0636748e

Fixes https://github.com/lxqt/qtermwidget/issues/163
Fixes https://github.com/lxqt/qtermwidget/issues/212
2018-09-30 01:22:31 +02:00
Luís Pereira c6880070e9 Don't use automatic string conversions
* Disables automatic conversions from 8-bit strings (char *) to unicode
  QStrings.
* Disables automatic conversion from QString to 8-bit strings (char *).
* Disables automatic conversions from QByteArray to const char * or const
  void *.
* Disables automatic conversions from QString (or char *) to QUrl.
* Use QStringBuilder for more efficient string creation.

It make us aware of string and encoding conversions.
2018-08-05 22:09:57 +08:00
Tsu Jan 3838728c22 Suppress compilation warnings 2018-07-16 17:24:13 +02:00
Yen Chi Hsuan c648297792 Support UTF-32 characters correctly
By replacing QString/QChar or quint16 with std::wstring and wchar_t
2018-02-28 10:49:41 +01:00
Chih-Hsuan Yen 733f4b6e8f Finish SGR mouse protocol (1006)
Some codes in https://github.com/KDE/konsole/commit/c83e7b638dcc42b617a067e6dc23686eccf23b00
are missing. Backport all of them.

Fixes #164
2018-02-06 18:07:19 +01:00
Yen Chi Hsuan 60221dae4c Support REP escape sequence defined in ECMA-48, section 8.3.103
Since ncurses 20170729, supporting REP is necessary for terminals with
xterm compatibility (TERM=xterm or similar). This patch fixes layout
issues with htop. [1]

[1] http://lists.gnu.org/archive/html/bug-ncurses/2017-08/msg00051.html
2017-09-10 21:18:58 +08:00
Yen Chi Hsuan 3e7f8d7875 Handle DECSCUSR signals 2017-07-21 19:51:55 +02:00
Donnie West d84849b04b Backport Vt102 emulation fixes (#113)
Also pull in KeyboardTranslator and Character updates
2017-04-24 21:26:56 +02:00
Luís Pereira 3ce71a3650 Fixes (#122)
* Prevent a possible C++11 range for detach

The solution with Qt>=5.7 is to use the qAsConst() macro.
But the qAsConst macro is just a const_cast to const T&.

* Don't call QByteArray::operator[]() on temporary

Just use the QByteArray::at().

* Adds missing reference in foreach

That's an non non trivial type (QString), using a reference as no drawbacks
and it performs better.

* Use QStringList::constFirst()

Drop QStringList::first(). It's faster and we might avoid detaching a
temporary.

* Don't call QList::operator[]() on temporary objects

It's not what we want. The at operator and QList::value() do the job in the
right way.

* Stops allocating an unneeded temporary container

We were allocating an temporary container (_entries.values(keyCode)) which
implies an extra iteration also.
Now we don't use any temporary container and only perform one iteration.
2017-04-22 11:55:16 +02:00
Petr Vanek 5ebc2c0780 Merge pull request #71 from f2404/70_assert
Avoid including source files names into the library binary
2016-05-25 09:13:53 +02:00
Igor fa2476bbc5 Replace assert() with Q_ASSERT() 2016-05-16 12:59:18 +03:00
Igor c472676560 Bracketed paste mode implementation 2016-02-01 19:26:39 +03:00
Paulo Lieuthier 186b8eaba7 Sort out terminal resizing 2015-11-06 09:13:21 -03:00
Paulo Lieuthier f792b5f5ca Rebase Vt102Emulation to Konsole 2015-11-06 08:58:23 -03:00
Jerome Leclanche 72ffc262eb Clean up trailing whitespaces 2015-07-09 20:22:48 +02:00
Petr Vanek 58c4da34cc fixed qterminal #71 qt5 version ignoring page up / down 2014-09-01 14:46:28 +02:00
Petr Vanek 5d3ef34cc2 fixed #11 compile against Qt 5 (Qt4 and Qt5 supported and waguely tested) 2014-04-11 21:28:52 +02:00
Petr Vanek df4f9ca0ec The control and tab keys don't work in Qt/E. This fixes it, but maybe not in the most elegant way. The trouble seems to be that _codec->fromUnicode(event->text()) doesn't handle control characters in qt-embedded. 2013-02-05 11:35:04 +01:00
Petr Vanek 6ad5d7070a merge changes from the experimental "bundle" repository 2011-06-22 13:12:21 +02:00
Petr Vanek 57fd23bf39 K&R formatting 2010-10-01 16:08:14 +02:00
Petr Vanek 88b5a11bb4 merge with qscite 2010-10-01 15:54:31 +02:00