Commit Graph

44 Commits

Author SHA1 Message Date
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
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>
2024-02-28 08:09:05 +00:00
Marcus Tillmanns
3795a94144 Terminal: Block Close Terminal
Fixes: QTCREATORBUG-30070
Change-Id: Id775bea9f3db851f07f6e86aedb02f975b5a7ee4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-08 08:24:53 +00:00
Marcus Tillmanns
a0c05cabcc Terminal: Refactor actions
Change actions to use ActionBuilder and
use ToggleAspects for tool buttons.

Change-Id: I0f4a58c3a98cb2804e3d387ea02cac043bd71ae7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-12 05:46:33 +00:00
Marcus Tillmanns
2da12ddc60 Terminal: Add select all action
Fixes: QTCREATORBUG-29922
Change-Id: I565f2f9f570610e1bb7f528cd874a0dd9c47dbe8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 11:32:01 +00:00
David Schulz
59cb505dd0 Terminal: fix typo
Change-Id: I92ccb9cee06517d7be86e2393209096e1b47c36a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-25 12:03:28 +00:00
David Schulz
30ef90c322 Terminal: add finished signal
Change-Id: I9d560d1f1bbaa94ae75420002744073a1e8fad1a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-23 10:24:48 +00:00
Marcus Tillmanns
1fabd72514 DeviceSupport: Add more error output
Previously most errors when opening shells were completely
opaque to the user. This patch adds error output either via
QMessageBox if there is another modal dialog, or as flashing
disrupting messages.

Change-Id: I54be7a90295b61c23c739294c2d1d37c288ad273
Reviewed-by: hjk <hjk@qt.io>
2023-10-06 08:26:15 +00:00
Marcus Tillmanns
92355bf40d Terminal: Lazily open remote terminals
Move the burden of finding the shell of a device from the shell menu
to the TerminalWidget, so that opening the shell menu does not block
the ui.

Change-Id: I7f2e5a891f20faa53a1e3eec879866219f9bee0b
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 07:09:48 +00:00
Orgad Shaneh
4ad3925da4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I5cdff1f5db3fae89beef3d27316b21440541bb1c
2023-07-30 16:24:15 +03:00
Marcus Tillmanns
80b23292b1 Core: Add searchable terminal
Change-Id: Id058fb1a97c967fc253b08edf3910f019e708b50
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-27 13:13:06 +00:00
Marcus Tillmanns
42ed82973c Terminal: Create Terminal solution
Change-Id: If271fd23a84c49bbc25fcc3b9bc0939c7237d095
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-27 12:03:17 +00:00
Marcus Tillmanns
79e839b29f Terminal: Add mouse support
Change-Id: Ibeb8e13b5f8f75f16ec86f64536235587c844ffc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-26 14:06:38 +00:00
Marcus Tillmanns
def291f260 Terminal: Improve paste performance
Pasting large amounts of data on macos would block the App indefinitely.

The issue was a blocking call to ::write. The first fix for that was to
set O_NONBLOCK on the tty stdout fd. The second fix was to pass the
actual result of the write back to the caller so they can react to it.

In the TerminalSurface we now check if the write was successful and
if not we buffer the data and try again later.

Change-Id: Ibc92cce57fad88b5e9aa325197b42e17bec5e746
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-26 09:48:17 +00:00
Orgad Shaneh
9a7f45cc46 Terminal: Allow the underlying application to set title
Change-Id: I3530d645f16047df2546902d900e5e2fee8d071c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-05 08:26:39 +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
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
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
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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