Commit Graph

100 Commits

Author SHA1 Message Date
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
Marcus Tillmanns
9b7b0d4f02 Terminal: Switch to std::chrono
QDateTime's interface various between supported Qt Versions,
so we use std::chrono instead

Change-Id: I5af5ae9950e61c2ed38ff15dc0580f0dc2aa1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-03 07:35:05 +00:00
Cristian Adam
d387802a3e Terminal: use shell name as terminal tab name
This way cmd, bash, powershell are more descriptive than "Terminal"

Change-Id: I19310f423cd4188ecc48580a30ed414833a15aee
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 16:54:59 +00:00
Cristian Adam
0a0827da41 Terminal: Improve keyboard shortcuts and mouse copy/paste
Change-Id: I7e032a48cc55143dd8fb038d74eb71c4ad8badac
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 16:54:53 +00:00
Marcus Tillmanns
d8dc1c7f0f Terminal: Improve performance while selecting
Change-Id: I4f0a7a937f6e600430d8c89e51d1ea2d1ab8687f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-02 14:20:01 +00:00
Marcus Tillmanns
76b55fd6e6 Terminal: Implement selection via double click
Change-Id: I7665df5f37836331f202f168828bb1b1636bf5de
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-02 14:19:56 +00:00
Marcus Tillmanns
46ccaa642f Terminal: Improve performance for cat /dev/random
Change-Id: Ibc7e09dd9388fd6f06f0bed3ade4e83d05f03c28
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:19:47 +00:00
Marcus Tillmanns
86da87d306 ProjectExplorer: Remove IDevice::terminalCommand
Since Terminals can now be started for device file paths, there
is no need anymore for IDevice::terminalCommand.

Change-Id: I01c831ea7ee29d53efa6880631e8c6d54a4316aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:13:19 +00:00
Marcus Tillmanns
1da18a4b62 Utils: Integrate ptyqt into qtcprocess
Integrating PtyQt directly into QtcProcess allows us to
start Pseudo terminal processes using the existing QtcProcess
functionality such as starting remote process on e.g. docker
or remote linux devices.

This is needed for the new Terminal plugin.

Change-Id: Iaeed5ff9b341ba4646d955b2ed9577a18cd7100f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:10:11 +00:00
Jarek Kobus
8b09ad8898 QtcProcess: Introduce PtyData
That's going to be used by PtyProcessImpl.

Change-Id: Ifc1a7886ceed73272c9e415414db49452175a334
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 14:10:06 +00:00
Marcus Tillmanns
ea64bb9d36 Terminal: Fix scroll behavior
Change-Id: I357a5d04baab881cf89c57fdf3336bd1e0077976
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-27 12:46:29 +00:00
Marcus Tillmanns
1381bd0963 Terminal: Fix \ on German mac keyboard
Change-Id: I87d4299c1e41f4a553b5ecc9690b2fd332b7b3e8
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-27 10:19:56 +00:00
Marcus Tillmanns
d3b4159b23 Terminal: Fix preedit area position
Change-Id: I8667a84e12154ca34517af25648a0983f918fc48
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-27 10:03:50 +00:00
Marcus Tillmanns
a21a5249de Terminal: Fix Background painting
Change-Id: I62d9e10b8e7e79985dc7a9b68d6a05db1e743261
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-27 10:03:39 +00:00
Marcus Tillmanns
558e9f4b16 Terminal: Add selection color setting
Change-Id: I66f94c3bd729975046ea72aca3bc23bb5024ced0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-27 10:03:15 +00:00
Marcus Tillmanns
c6dc54b343 Terminal: Add Shell option menu
Change-Id: I08ea3c52ed28ab65f2dc902051bab9e6975e6a7e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-24 13:37:14 +00:00
Marcus Tillmanns
682ef157d8 Terminal: Add Terminal plugin
Adds a new Terminal plugin that provides a Terminal pane inside
Qt Creator.

Fixes: QTCREATORBUG-8511
Change-Id: I7eacb3efa2463d7df9f383ae3fc33254fb9019a9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-02-24 10:19:33 +00:00