Commit Graph

66 Commits

Author SHA1 Message Date
Marcus Tillmanns
6e64a75cb7 Terminal: Fix base Environment
Change-Id: I509333df419f88b922dd69a4ee6484f2c809c31d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2023-06-14 10:15:03 +00:00
hjk
362772442a All: Fix some more Qt 6.7 induced deprecation warnings
Change-Id: I4f3fc9c34ff664ab153d4a9a641ec84a11e555a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-08 11:40:23 +00:00
Marcus Tillmanns
8c381c719b Terminal: Fix painting multi char preedit
Preedits on linux can often contain more than one character.

Also changes the painting from white on black to painting with
just an underline.

Change-Id: I6769217ca80cf131aa3fb96b20e23b717f591467
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-08 11:14:19 +00:00
Marcus Tillmanns
f83fb72af8 Terminal: Fix assert
ShortCutMap::addShortCut did assert if the keysequence was empty.

Changed Q_ASSERT to QTC_ASSERT to not crash.

Change-Id: Ib03e21bb00ab989e00d5c3de68b52b84c6eb2360
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-08 06:24:33 +00:00
Marcus Tillmanns
217b03c1ac Terminal: lock/unlock keyboard
We copied QShortCutMap into Qtc to allow us tight control over which shortcuts
are "enabled" while the focus is inside a terminal, and the keyboard is "locked"
to the Terminal. Locked here means that except for a select few, all key presses
are send directly to the terminal and cannot be used to activate other actions.

Change-Id: I96cddf753033c0f4e7d806b20085bb4755853117
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-07 10:29:47 +00:00
Marcus Tillmanns
886ca55b5a Terminal: Fix warnings about re-registered action
Especially on Linux the pointer value of the Terminal might be reused,
leading to warnings about actions being registered for the same context.

Cleaning up the registration fixes this.

Change-Id: Ie1d53bf79581e9f98576e7a4e70420ec63da0f86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-07 07:25:13 +00:00
Orgad Shaneh
e92a131644 Terminal: Fix MSVC warning
warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Change-Id: I5d57843eba79f0eb023ea7e3c4149aa515430189
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-05 07:33:46 +00:00
Marcus Tillmanns
9f1a2c4f8f Terminal: Rework commands
This rework fixes the way commands are registered in Qt Creator.

Change-Id: I401f3ac7d9194dad8fceb507360ddc3633106eb4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-31 13:17:49 +00:00
Marcus Tillmanns
3416ccd7ec Terminal: Fix selection
When moving the mouse left or right out of the viewport
the selection would grow into the previous/next line
without the bounding.

Change-Id: Ica38eac3b306338ef24aa4abace66f110edb2aef
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-16 11:50:18 +00:00
Alessandro Portale
f2213db913 Terminal: Fix warning
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]

Change-Id: Ib66cbde9ff48f31d1a5ca97c8bafb0efd419dc2e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 06:34:49 +00:00
Marcus Tillmanns
734f559b76 Terminal: Fix cursor/viewport updates
Under some font sizes the cursor size and cell size were not correctly
aligned on the pixel grid, leaving behind artifacts of prior draws.

Change-Id: I25e6efdc44102f24672912e1e56c31be0c686b89
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:20:42 +00:00
Marcus Tillmanns
f4abb1ec4a Terminal: Remove unnecessary destructor
Calling Aggregate::remove is not necessary and led to a warning message.

Change-Id: I51cdd7bfa9bdda7a3ebedf6a86e48fe54fd8f3ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-05 09:21:51 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Marcus Tillmanns
aeb2b458d0 Terminal: Allow dropping files
Change-Id: I978ea72d6de7df6c31d1d2d2368e7aadf835279d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-26 07:08:08 +00:00
Marcus Tillmanns
d05faf64f4 Terminal: Correctly parse url links with empty path
Previously urls such as http://google.com were appended to the current
dir, as FilePath::isAbsolute would return false since there is no path.

Change-Id: I17546aed322a74f6b8cbcc166d37608fd809fd1e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 13:06:11 +00:00
Marcus Tillmanns
388e516200 Terminal: Improve link copy
* Show link if control key is pressed (without mouse move)
* Copy link on Control+Shift+Click
* Add Copy Link Action to Right click menu

Change-Id: Ide4ff4e77c03e015117c67f09c9d60dedd14dfcb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 09:25:36 +00:00
Marcus Tillmanns
b999e5700e Terminal: Fix docker cmd for terminals
* Fix env for terminals

Change-Id: Ie16a74aeca3ad34a76af1dee0c5a01e607aabebb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 05:59:35 +00:00
Marcus Tillmanns
94c4800ad8 Terminal: Fix crash when reusing TerminalWidget
Change-Id: I9d30df1abbecabd3909078e0a609fe5ba96769ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-03 07:53:23 +00:00
Marcus Tillmanns
5db27d21da Terminal: Add setting to change arguments of default shell
On non windows systems, initialize it with "-l" to start a login shell.

Change-Id: I972f845c3933c6a54752d4c71108a658311a0256
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-28 07:13:00 +00:00
Marcus Tillmanns
4ab5eb5339 Terminal: Fix warning messages
Change-Id: I1ab473c79219cf6e2adefaa1349b4675a2455b2f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-27 09:30:09 +00:00
Marcus Tillmanns
2eb4884742 Terminal: Make audible bell configurable
Change-Id: I6cc02f2f1b873f39352151265fb7ba1fe0f170fc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-27 09:29:54 +00:00
Marcus Tillmanns
af5f702f54 Terminal: Make ESC key behavior configurable
Change-Id: I806870c5dd7edbcd3ac2642849cca82f1939ce01
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-27 09:29:47 +00:00
Marcus Tillmanns
ae94d3b7ea Terminal: Handle bell
Change-Id: I61681166fc8e489ffd0807cf3bcb4a2abc9cf6e1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-24 16:12:05 +00:00
Marcus Tillmanns
9417f8b99e Terminal: Add search
* Adds new search widget to terminal
* Adds new theme color "TerminalFindMatch"
* Fixes ESC key handling in terminal

Fixes: QTCREATORBUG-28946
Change-Id: I7b6057d13902a94a6bcd41dde6cc8ba8418cd585
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-24 16:12:01 +00:00
Marcus Tillmanns
17a482bebe Terminal: Support paste via Middle mouse button
Fixes: QTCREATORBUG-28943
Change-Id: If48c021e509e10fd13e6e5356d0a364e91aae8da
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-24 13:16:23 +00:00
Marcus Tillmanns
7fe4fde886 Terminal: Open directory links in navigation
Fixes: QTCREATORBUG-28938
Change-Id: If49def66501ff29f72d8a92e3971da6be5d93367
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 14:07:00 +00:00
Marcus Tillmanns
1c099b2bd2 Terminal: Use current dir for links
Fixes: QTCREATORBUG-28942
Change-Id: I424676d3ef3395eead9c4c0c0e826e1c44500b40
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 14:06:52 +00:00
Marcus Tillmanns
e045c643c3 Terminal: Support Alt+Left / Alt+Right cursor move
Fixes: QTCREATORBUG-28941
Change-Id: I7c8e012733f6dcb2851e8e1b840d53317e413cd8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 14:04:59 +00:00
Marcus Tillmanns
af809b3a52 Terminal: Add context menu & Settings button
Fixes: QTCREATORBUG-28937
Change-Id: I9dab5da0adccb8cff4d4e824ead0eba3e27eef5c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 12:32:07 +00:00
Marcus Tillmanns
a485f18a94 Terminal: Make shortcuts configurable
Fixes: QTCREATORBUG-28940
Change-Id: I1afe114c357243a8fa4f101b5eac80a766dc87b9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 12:31:53 +00:00
Marcus Tillmanns
5341570572 Terminal: Move color mapping to widget
This allows us to easily update the view when the colors are changed
in the settings.

Change-Id: I0b4f150b4fc9cec9aee2796d63f2395e05ce70df
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 11:32:51 +00:00
Marcus Tillmanns
0870f2583b Terminal: Enable TerminalProcessInterface
Adds a new helper app "process_stub" that replaces the previous.
"process_stub_unix/win". The purpose was and is to allow processes
to be "injected" into other hosts apps like terminals while still
being able to control and debug them.

A new base class called "TerminalInterface" is used for both the new
Terminal plugin and the legacy TerminalProcess implementation.

Fixes: QTCREATORBUG-16364
Change-Id: If21273fe53ad545d1a768c17c83db4bf2fd85395
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-03-20 10:03:23 +00:00
Marcus Tillmanns
2d2eef1c2c Terminal: Fix "Enter does not work after copy"
Change-Id: Ic541ba15f52084bcd9b955af718efc3defc64539
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-20 09:45:23 +00:00
Marcus Tillmanns
5972452484 Terminal: Support clipboard selection
Change-Id: Ief59f9e21782e0dd0292f3625e35c1742cf9b3bc
Reviewed-by: hjk <hjk@qt.io>
2023-03-18 13:03:17 +00:00
Marcus Tillmanns
bd52e53dbf Terminal: Add shell integration
Change-Id: Ic1e226b56f0103e5a6e7764073ab7ab241b67baa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-16 06:08:09 +00:00
Jarek Kobus
a43c20969c QtcProcess: Remove TerminalMode::Pty enum value
Make Pty::Data optional. When set, the PtyProcessImpl
implementation is implied.

Change-Id: I7990e9d9016223e6597d876a5d0c4ed177365874
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-15 13:52:45 +00:00
Marcus Tillmanns
887f6afd25 Terminal: Auto-scroll when selecting outside
Change-Id: I5dea3256524634d9c3e6c0f8132c6bdba4494978
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-12 09:22:38 +00:00
Cristian Adam
215bd2ef2b Terminal: fix copy to clipboard of bottom up selection
The multi line selection from bottom right corner to top left was broken
for copy to clipboard.

Change-Id: Ica40ec2ce5bb7b9d4b0187ebb454cd16e039e339
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-11 12:26:47 +00:00
Marcus Tillmanns
ddad64e176 Terminal: Fix multi-line copy&paste
Previously all lines would be copied into one without lines breaks.

Change-Id: Id87dbde84a19ccbc5f53438a305173d1b070eaba
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-11 11:19:24 +00:00
Marcus Tillmanns
7ceb185539 Terminal: Fix line selection mode
Change-Id: I03d4bf7343a49b19edfcb20d1eb57bfe18703ddf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-11 11:18:31 +00:00
Marcus Tillmanns
e54b0e93c2 Terminal: Fix selections
Selections were invisible if a cell with a background color
was selected.

Changes to the terminal did not reliably reset the selection.

Change-Id: I923223f43e5ee1b6576966f9dd791aa109ac1d5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-09 19:57:17 +00:00
Marcus Tillmanns
b95c0d247d Terminal: Fix "altscreen" handling
When "altscreen" is enabled ( e.g. when starting nano ), the terminal
switches into an alternate mode without scrollback buffer.

This was not correctly handled where the scrollback buffer would stay
active.

Change-Id: I443d26383d9cd908befcd24a837ecf84c0c1e849
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-09 19:57:08 +00:00
Marcus Tillmanns
665ae04605 Terminal: Open Link with line/column info
Change-Id: I3e70a7c33a935b7bd3e12fb903148bcd60ff55aa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-09 19:56:48 +00:00
Christian Stenger
0f1f5435ea Terminal: Fix build before Qt6.4
Change-Id: Idc1138289516eb2cdeffc310cec4b9ba019d1b16
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-07 05:54:58 +00:00
Marcus Tillmanns
f95f815e98 Terminal: Add support for Cursor shape and blink
Change-Id: I7f71578a714d375bcd4ef8ae431f4127cbc57a55
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-06 22:55:50 +00:00
Marcus Tillmanns
098c76832a Terminal: Rewrite rendering
The rendering has been rewritten to use cached GlyphRuns instead
of text layouts. The VTerm specific code was moved into
TerminalSurface.

Change-Id: I10caa3db4ee932414987c9ddae2dcb777dc1f6e7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-06 15:41:29 +00:00
Marcus Tillmanns
74f15c99ce Terminal: Fix Ctrl+[A-Z] and '|'
Change-Id: Id245a015d6092236c20634c47af682bcf073d982
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-03 20:00:02 +00:00
Marcus Tillmanns
7fc674b566 Terminal: Fix "nano" titlebar
QTextLayout ignores trailing spaces, and does not draw their
background color. Converting them to Nbsp fixes this.

Change-Id: I19a363bcb4792c613eb9c59f7caaa40fa631b937
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-03 19:59:30 +00:00
Marcus Tillmanns
dc4ec494b3 Terminal: Fix mouse selection
Previously m_selection was not correctly ordered such that start < end.
This patch fixes that and also adds optional debug visualizations to aid
in debugging / validating the selection.

Change-Id: I9b0d2fcd917f39eeb5082bc374796fed91521c7c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-03 19:55:05 +00:00
Marcus Tillmanns
240686b7ea Terminal: Start with disabled copy action
The copy action should only be enabled once a selection exists.
In the beginning no selection can exist, therefore the copy action
is disabled.

Previously this lead to a bug where only the second "Enter" keypress
was passed on to the terminal.

Change-Id: Iac01c273f70a50a4fc131bd6a2bbb1507705b853
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-03 08:24:31 +00:00