Commit Graph

100 Commits

Author SHA1 Message Date
hjk
b442ca3873 Core: Rename ActionBuilder::setOn* to addOn*
There could be multiple connections.

Change-Id: I7dbca9d24599f776b7d1f1bfa11826e3eeb5640a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-13 13:00:00 +00:00
hjk
016936a450 Clean up some lambdas
Change-Id: Id947c0935b1aa4579e1c64d3e510db41103fbe27
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-12-12 10:55:32 +00:00
Jarek Kobus
8d2cee31e4 TerminalWidget: Fix a warning about no return value
Amends a0c05cabcc

Change-Id: Ieb969f7a6c61469f69e8503089e4985fa8380e3c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-12-12 09:34:12 +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
Eike Ziller
f0f4780ec0 Merge remote-tracking branch 'origin/12.0'
Change-Id: I22e6a20e5a6fc84f777b6cffbd9fb484c90bc51d
2023-11-16 08:45:30 +01:00
Marcus Tillmanns
7819fc5dfb Terminal: Only unlock exit on macOS
Fixes: QTCREATORBUG-29902
Change-Id: Ifbb1f12c874f2f68483a34ac6e117214211e5be4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-15 14:13:48 +00:00
Eike Ziller
056168beca Merge remote-tracking branch 'gerrit/12.0'
Conflicts:
	src/plugins/texteditor/texteditor.cpp

Change-Id: I76620975760a8f9e64f6d381c948d457e949a87c
2023-11-15 10:32:59 +01:00
Xavier BESSON
223deb5968 Shortcut to enable/disable shortcuts routing to terminal
Fixes: QTCREATORBUG-29876
Change-Id: I8b04c09ce1de7dab968499773179f663c1c6fe7d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-13 13:41:04 +00:00
Eike Ziller
4bd29f741c Merge remote-tracking branch 'origin/12.0'
Change-Id: I517dc84e975a570edd363253ad444a01799dbc4b
2023-11-06 10:51:11 +01:00
Marcus Tillmanns
201857fa68 Terminal: Fix Url handling
FilePath::toUrl does not pass queries correctly to QUrl.
So we use QUrl::fromUserInput directly.

Fixes: QTCREATORBUG-29850
Change-Id: If0706b3b37d03eeea87247b44f07f8a0f8915a95
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-06 08:22:02 +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
Eike Ziller
df80454d26 Merge remote-tracking branch 'origin/12.0'
Change-Id: I04104ef638b28d99da11b9b7a22f31f8d0ddf460
2023-10-24 13:05:55 +02: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
Eike Ziller
ad7d559028 Tr: More small fixes
Change-Id: I5d9324d3f64eaa522fa1d435efa39fa43d84798a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-10-18 12:10:45 +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
Christian Kandeler
bdded29b33 qbs build: Improve some base items
Clean-up, simplification and modernization.
Also fix the bugs uncovered by this.

Change-Id: Ia3a77557f10faf9a901540a55fd6c07a2e986bf5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-18 11:50:09 +00:00
Marcus Tillmanns
e17866e283 Terminal: Show key when input is hidden
Change-Id: I5fca6a8c4f43ea2b95bad4df247b5df0abad521c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-05 13:18:36 +00:00
Marcus Tillmanns
616a0c0f77 Terminal: Support Ctrl+C/V on Windows
When a selection is present, let Ctrl+C work as copy
on Windows.

Remove sending ESC key in clearSelection as it interfered
with a Paste after copy.

Change-Id: I92db7f263e1eb433bca8aa5500fcecb637a23f90
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-31 10:58:36 +00:00
David Schulz
5122d8addc Merge remote-tracking branch 'origin/11.0'
Change-Id: Idbf5f641aa9db7574cf2a4bd09adb8bcd03da894
2023-08-22 08:10:48 +02:00
Marcus Tillmanns
64b852e186 Terminal: Fix default environment vars
Fixes: QTCREATORBUG-29515
Change-Id: I1d14f228f946a64a8d3cdb17f57ae9058db549ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-21 06:43:01 +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
Marcus Tillmanns
385ff37f88 Terminal: Fix selection
A missing call to the base class meant that when starting to search with
a selection set, the selected text was not copied into the search field.

Change-Id: I1f2f1054a687d8b33b6733cc2a96e85ffa7f7816
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-31 11:23:47 +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
hjk
b14b7b1a5f Replace a few more Aspect::value() calls with operator() uses
Change-Id: I9343e74bfb51af41df02a411976b82b9260be2fb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-20 09:31:09 +00:00
hjk
bedab22e63 Replace a few aspect.value() calls with operatpor()
Change-Id: Icaada671fe8dbe59d4f596da49476b3ec2137c25
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-19 05:14:13 +00:00
hjk
dbb1e04c77 Terminal: Use new settings creation pattern
Does not delay much yet, as settings() is accessed in
Plugin::extensionInitialized()

Task-number: QTCREATORBUG-29167
Change-Id: I8f7c7fbef78c4ce0f92302e57a81f6216456c27b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 11:38:11 +00:00
Marcus Tillmanns
f02d0354c4 Terminal: Dont show process exit code
Show it as a "flashing" message instead

Fixes: QTCREATORBUG-29373
Change-Id: Ib9e7280a1b80cc52835aecb954f80e9daa80f7ca
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2023-07-05 15:39:29 +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
hjk
d0d1e1af1f A few more direct FilePathAspect value accesses
Task-number: QTCREATORBUG-29167
Change-Id: I8eba582303c16dddbdb5cea5bce43f048bac06b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-04 13:08:00 +00:00
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