aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/terminalinterface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Process: Implement generic "run as user" in back-endsChristian Kandeler2025-10-221-1/+3
| | | | | | | | More preparation for this feature. No non-root user can actually be set anywhere yet. Change-Id: I81009e3c313f84b1d958fdb264de6eb6fcbe7ab2 Reviewed-by: hjk <hjk@qt.io>
* Utils: Store a user name in ProcessSetupDataChristian Kandeler2025-10-221-1/+1
| | | | | | | | Preparation for more general "run as" functionality. No functional changes for now. Change-Id: I547bd13bbc3c0987f748242896c85c228257304f Reviewed-by: hjk <hjk@qt.io>
* Utils: Use original environment for process stubMarcus Tillmanns2025-04-241-0/+1
| | | | | | | | | | | | | Qt Creator removes the path to the Qt binaries from its environment when its started from another Qt Creator. The process stub needs the PATH though with those, so we set the environment of the stub to be the "originalSystemEnvironment" Amends: e281855dfaacebe0b9127bb15f1e3a207af2544b Change-Id: I7a18a46f3e57eaf463e36839f35c3467ee33e71b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Fix warning for ';'Marco Bubke2025-04-151-1/+1
| | | | | | | | The macro already contain a ';'. Removing the argument or [[maybe_unused]] would maybe even a better approach. Change-Id: I31750d10a4f252c667e7c0e5e13bf1085dbe11a2 Reviewed-by: hjk <hjk@qt.io>
* Replace a few make_unexpected with ResultErrorhjk2025-04-151-4/+4
| | | | | Change-Id: I64637b8b43c1932dee59e37b8922c18d27c2deb9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Replace most expected_str by Utils::Resulthjk2025-04-111-3/+3
| | | | | | | | Keep it in Axivion dto, which is generated. Change-Id: I83a12de6234ac7b0218b369875bdc72d25dbadfb Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/13.0' into 14.0Eike Ziller2024-06-041-13/+3
|\ | | | | | | | | | | | | Conflicts: src/plugins/copilot/copilotsettings.cpp Change-Id: I6d17cf8968d6efbafb883da8346c7950349f7d84
| * Utils: Fix terminal process environmentMarcus Tillmanns2024-06-041-13/+3
| | | | | | | | | | | | | | | | | | | | | | The TerminalInterface did not fallback to the system environment if no environment was set by the user. Instead it had platform specific code that saved over the path. Instead we just apply the user changes to the system environment. Change-Id: I011f1a9d935c958265b2bda8257ad8611f06e578 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | CommandLine: Use more 1-arg c'torJarek Kobus2024-05-161-1/+1
|/ | | | | Change-Id: If52c4094f94859d51e31862d913b1756e333e512 Reviewed-by: hjk <hjk@qt.io>
* Terminal: Fix handling stub timeoutMarcus Tillmanns2024-02-131-0/+1
| | | | | | Change-Id: Idaf18ac404d878382d5912793a667200bd7fe6f9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Fix various mis-uses of Environment::forEachEntry()Christian Kandeler2023-11-071-2/+3
| | | | | | | | Most of them introduced with 08bacd3f19b817a7ffbd606a92eff5000eaaca2c. Fixes: QTCREATORBUG-29857 Change-Id: Ia897958865f00cb5f8f141659a652aee05aa1355 Reviewed-by: hjk <hjk@qt.io>
* Utils: Fix crash if stub fails to startMarcus Tillmanns2023-11-071-0/+7
| | | | | | | | | If the inferior did not start the TerminalInterface did not send an error up the chain, which meant that the runcontrol does not exit. This would lead to a crash. Change-Id: Icf9f8f913d84a9ed6414e15ce3a3587b1580425e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Avoid some FilePath::toString() useshjk2023-07-201-4/+4
| | | | | Change-Id: I7d6ee7739e14a25787ca661e10cc24fa6c536780 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Terminal: Fix exit reporting in error casesMarcus Tillmanns2023-06-301-1/+3
| | | | | | | | | | | | | | Previously the finished signal was sent not sent soon enough for the Process to recognizes it correctly. Also, the process stub would exit prematurely in cases of crashes. The process stub should only return an error exit code if it did not show the "waiting for keypress" message. Fixes: QTCREATORBUG-29350 Change-Id: I86f7d75bacbdb5ee2b0009669926d94b6a75346a Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Terminal: Don't use askpassMarcus Tillmanns2023-06-151-9/+1
| | | | | | | | | Askpass is not needed for terminals. You can enter the password inside the terminal. Change-Id: I700efbc16cbf4bd9904c8652867af894e314785b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Add Extra Data to Terminal processMarcus Tillmanns2023-06-141-0/+4
| | | | | | | | Allows a terminal to display the "correct" program name. Fixes: QTCREATORBUG-29281 Change-Id: I73dacf71078dd1407ddda7bbc33a93c5ad172cbf Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Terminal: Fix setting environment for stub processMarcus Tillmanns2023-06-141-1/+1
| | | | | | | | | | | | | | The TerminalInterface was setting the environment of the target process for the stub, this is uneccessary. The ExternalTerminalProcessImpl was not using the environment of the stub process which will be important later. The TerminalProcessImpl was not setting the right environment either. Task-number: QTCREATORBUG-27519 Change-Id: I89238feedd755d1f1cbe2255b71711e0d5c149d0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Utils: Send ack from Process stubMarcus Tillmanns2023-06-121-0/+2
| | | | | | | | | | Allow the server to listen for command results. Fixes Qt Creator hanging when stopping application being debugged. Change-Id: Ia175b1bb1836b5593bc073394fa152923e1dda28 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Utils: Dont auto add sudo to all processesMarcus Tillmanns2023-06-121-0/+16
| | | | | | | | | | | Terminal processes need to add to the stub and not the target app, so sudo is only automatically added for default processes. The terminal interface is changed such that sudo is added to the stub. Task-number: QTCREATORBUG-27519 Change-Id: Ife11e937644c4e946401a5b079e90fa64aee2c52 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ProjectExplorer: Don't allow remote run in terminalMarcus Tillmanns2023-05-151-2/+0
| | | | | | | | | | Currently the process stub does not support starting / debugging processes on remote devices. To reflect this the "Run In Terminal" aspect is disabled for remote targets. Fixes: QTCREATORBUG-29058 Change-Id: I9b3bcd65d4db468c683f2743a49227bfbecaf3d3 Reviewed-by: hjk <hjk@qt.io>
* Utils: Combine startStubProcess parametersMarcus Tillmanns2023-05-081-4/+5
| | | | | Change-Id: Ic0515a3864687494bd1e280a82b91a5bafef46b1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Add TerminalMode::DetachedMarcus Tillmanns2023-05-041-0/+21
| | | | | Change-Id: Ic36845d3469719e17f24602ce80f3e6cfc984fbf Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Send __qtc marker from stubMarcus Tillmanns2023-04-041-0/+2
| | | | | | | | | | Docker and ssh devices need the real process id on the remote device. The process stub now send this if it receives it as the first line of output. Change-Id: I5d3af39651958fc88d21c3854a0fa1d7f51547a6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Terminal: Use QtcProcess to start terminal windowMarcus Tillmanns2023-03-211-2/+2
| | | | | | | | | | | Previously DesktopDevice::openTerminal used custom code to open a terminal window. This patch changes it to use QtcProcess with TerminalMode::On. This also removes the need for "openTerminal.py" on macOS. Change-Id: Iec978bdd19487ff8e59dcd88c35c2d01b0681022 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Utils: Re-add "press enter to continue" to stubMarcus Tillmanns2023-03-211-3/+14
| | | | | | | | | | | | To keep the terminal from closing immediately, ask the user to press enter after the inferior exited. Make it configurable as the terminal plugin does not need this. Change-Id: I1949895f022a54539a6139be9f92fdc698f6534e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Terminal: Enable TerminalProcessInterfaceMarcus Tillmanns2023-03-201-0/+400
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>