┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/terminal/terminalpanel.cpp
AgeCommit message (Collapse)Author
2026-01-28panel/terminal: Add ability to disable konsole url syncEgor Maksimov
Sometimes when you work on the project using the build in konsole, most commands are meant to be run at the project root. This allows for user to disable URL sync so that one could browse the project tree without constantly needing go back to the root folder just to run a command. BUG: 306381
2024-11-25Switch to C++20Méven Car
2024-09-02[terminal] Don't try to change dir into an empty URLNicolas Fella
SENTRY: DOLPHIN-2Q4
2024-01-10terminalpanel.cpp: Set m_konsolePart to nullptr during exit signalAkseli Lahtinen
If Dolphin terminal is open, and one types `exit` there and then closes Dolphin, Dolphin crashes due to a dangling pointer. Konsole KPart is deleting itself when Konsole session exits, but Dolphin tracks it as a child of the Terminal Panel. The Terminal Panel doesn't get destroyed when Konsole KPart does, and it tries to double free during children clean up. (Thanks @sitter !) Setting `m_konsolePart` to `nullptr` during exit signal fixes this, since there is already check in place for that in the destructor. BUG:479596
2023-12-26Do not rely on KIO source-code compat codeAlexander Lohnau
2023-11-10Set position of KMessageWidgetCarl Schwan
To use a more frameless style
2023-09-28TerminalPanel: Disconnect signal in destructor only when we have a konsolePartMéven Car
2023-09-19TerminalPanel: Disconnect destroyed signal in destructorKai Uwe Broulik
Otherwise, when QObject cleanup, which runs after our destructor, destroys the terminalPart, it would call back into us when we're already half-destroyed. This trips an assert in Qt "Called object is not of the correct type (class destructor may have already run)"
2023-09-19Merge branch 'master' into kf6Nate Graham
2023-09-16terminalpanel: Improve Konsole missing messageOliver Beard
It now forces the pane to fit its height, and will animate on every appearance.
2023-07-07Fix konsolepart lookupNicolas Fella
The location changed for KF6
2023-07-05Add explicit moc includes to sources for moc-covered headersFriedrich W. H. Kossebau
* speeds up incremental builds as changes to a header will not always need the full mocs_compilation.cpp for all the target's headers rebuild, while having a moc file sourced into a source file only adds minor extra costs, due to small own code and the used headers usually already covered by the source file, being for the same class/struct * seems to not slow down clean builds, due to empty mocs_compilation.cpp resulting in those quickly processed, while the minor extra cost of the sourced moc files does not outweigh that in summary. Measured times actually improved by some percent points. (ideally CMake would just skip empty mocs_compilation.cpp & its object file one day) * enables compiler to see all methods of a class in same compilation unit to do some sanity checks * potentially more inlining in general, due to more in the compilation unit * allows to keep using more forward declarations in the header, as with the moc code being sourced into the cpp file there definitions can be ensured and often are already for the needs of the normal class methods
2023-04-22TerminalPanel: rename currentWorkingDirectoryIsParentOf to ↵Méven Car
currentWorkingDirectoryIsChildOf NO_CHANGELOG
2023-04-21TerminalPanel: better check if terminal needs to change its ↵Méven Car
currentWorkingDirectory when unmounting CCBUG: 467403
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2022-11-23Use \r to terminate command in integrated terminalHaozhe Jiang
\r should be used instead of \n BUG: 458411
2022-10-02terminal: Clear line using escapes instead of SIGINTJohn Brooks
Sending SIGINT can be destructive, for example if we interrupt the loading of the shell init files (e.g. .bashrc) and clobber history preservation settings. Follow the example of Kate and send a Ctrl-E Ctrl-U to clear the prompt instead. BUG: 279614 Signed-off-by: John Brooks <[email protected]>
2022-09-26Remove unused includesLaurent Montel
2022-04-27Fix terminal panel not keeping up with dir changesFelix Ernst
The terminal panel is supposed to show the same location as the currently active Dolphin view at all times. However there was an issue when the terminal is supposed to quickly switch to a new location and then back again to the old one. The terminal ignored the switch to the old location unless it had already fully switched to the new location. Because it isn't particularly fast at fully switching to the new location, it would never do the expected thing of switching back to the old location. This commit makes it so the switch to the old location is only ignored if there are no in-progress switches to a different location. BUG: 391380 BUG: 416690 FIXED-IN: 22.04.2 Not totally sure if this fixes everything but it seems like an improvement.
2022-01-25Expose konsolepart shortcuts in Dolphin's shortcuts viewStephan Sahm
Adapt some changes from Yakuake https://invent.kde.org/utilities/yakuake/-/commit/a0b08cb1f71ef18449bfbf5852c01e323604142f credit to Stephan Sahm @schlichtanders BUG: 428265
2021-12-01Port away from deprecated KPluginLoaderAlexander Lohnau
2021-07-04Port konsolepart loading to use KPluginLoader directlyNicolas Fella
No need to go via KService
2020-10-23Compile with QT_NO_KEYWORDSAlexander Lohnau
2020-10-23If include is define in .h remove it if it's defined in .cpp too (scripted)Laurent Montel
2020-09-13Fix style, not space between method name and (; improve wordingAhmad Samir
GIT_SILENT
2020-09-13TerminalPanel: StatJob::mostLocalUrl only works with ":local" protocolsAhmad Samir
StatJob::mostLocalUrl was changed to cancel the job automatically if the protocol Class isn't ":local", mostLocalUrl only makes sense with ioslaves that actually set UDS_LOCAL_PATH (which should have calss ":local"). I tested that kio-fuse still works, when having the terminal panel open and changing direcotries in Dolphin, with an sftp:// server.
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2020-05-04Fixes Dolphin crash on "Defocus Terminal Panel" menu click if no Konsole is ↵Nikolai Krasheninnikov
installed. Summary: Dolphin crashes if no Konsole is installed and user clicks menu action "Defocus Terminal Panel". This fix is pretty straight forward. Steps to reproduce: 1. Run Dolphin without Konsole available. 2. Press F4 to open console window. 3. Click in service menu "Focus Terminal Panel". 4. Click in service menu "Defocus Terminal Panel". Observe the crash. Test Plan: 1. Run Dolphin without Konsole available. 2. Press F4 to open console window. 3. Click in service menu "Focus Teminal Panel". 4. Click in service menu "Defocus Terminal Panel". 5. Click in service menu "Focus Terminal Panel". 6. Press F4 to close console window. Reviewers: #dolphin, meven, elvisangelaccio, ngraham Reviewed By: #dolphin, meven, elvisangelaccio, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D29345
2020-04-07Sync terminal with KIOFuse mount when browing remote directoriesAlexander Saoutkin
Summary: Adds the capability to sync the terminal with a KIOFuse mount if the URL is remote. Partly based on the existence of another DBus currenly in review: https://invent.kde.org/kde/kio-fuse/-/merge_requests/21 Syncing works in both "directions". Changing the URL to a remote URLin the DolphinView will change the URL in the terminal to the KIOFuse local path equivalent. Conversely changing the URL in the terminal to one that happens to be in a KIOFuse mount will change the URL in the DolphinView to the remote URL equivalent. Test Plan: Manual testing (see video in comments). 1. Checking that changing directory in DolphinView from remote/local to local doesn't cause any regressions. 2. Checking that changing directory in terminal from local to local (but not in KIOFUse mount) doesn't cause any regressions. 3. Checking that changing directory in DolphinView from remote/local to remote correctly changes URL in terminal to KIOFuse equivalent. 4. Checking that changing directory in terminal from local to KIOFuse path correctly changes the URL in the DolphinView to the remote equivalent. 5. Checking the KIOFuse not being installed doesn't cause any regressions. 6. Changing directories very quickly does not cause any slowdown. Reviewers: #dolphin, fvogt, elvisangelaccio Reviewed By: #dolphin, fvogt, elvisangelaccio Subscribers: elvisangelaccio, fvogt, kfm-devel, ngraham Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28290
2019-12-05Add action for focusing Terminal PanelNate Graham
Summary: Add an action for focusing and de-focusing the Terminal Panel. FEATURE: 185096 FIXED-IN 20.04.0 Test Plan: - Hit {key Ctrl Shift F4} or click {nav Tools > Focus Terminal Panel} or {nav Control > Tools > Focus Terminal Panel} - If the Terminal Panel was closed, it opens and gains focus - If the Terminal Panel was open but unfocused, it gains focus - If the Terminal Panel was open and focused, focus returns to the view {F6630289, size=full} Reviewers: #dolphin, elvisangelaccio, rominf Reviewed By: #dolphin, elvisangelaccio, rominf Subscribers: kfm-devel, elvisangelaccio, rkflx, ngraham, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D10959
2019-08-11Fix an issue with focus lost after closing terminal panelAndrey Yashkin
Summary: After leaving terminal with Ctrl-D or exit commands the input focus isn't set back to the folder view. The problem appears, because `TerminalPanel::isHiddenInVisibleWindow` returns not what it supposed to return, since when the terminal process exits, `m_terminal` is set to nullptr. I moved unwanted checks from it inside `TerminalPanel::dockVisibilityChanged` This change also exposes a crash in `DolphinMainWindow::slotTerminalPanelVisibilityChanged()`, which was previously working only by luck. Now we check whether `m_activeViewContainer` is not null before using it. BUG: 407979 FIXED-IN: 19.11.80 Test Plan: 1. Open Dolphin 2. Press F4 to open the terminal panel 3. Type exit<Enter> or press Ctrl-D 4. Check current focus widget Reviewers: #dolphin Subscribers: ngraham, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D22420
2019-07-28Fix dir change when show hidden terminal panel with running program in itAndrey Yashkin
Summary: Terminal panel doesn't change its working directory, while any procces is running in it. However, if you hide it and show again the program will get a string with a //cd path// command. Test Plan: 1. Open dolphin 2. Press F4 3. Start any process like gnu nano 4. Press F4 two more times Reviewers: #dolphin Subscribers: anthonyfieroni, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D22422
2019-02-27remove deprecated methodsLaurent Montel
2019-01-19Ask for confirmation when Closing Dolphin windows with a terminal panel ↵Nate Graham
running a program Summary: Ask for confirmation when Closing Dolphin windows with a terminal panel running a program. FEATURE: 304816 FIXED-IN: 19.04.0 Test Plan: # Open terminal panel # Run `watch ls` # Close Dolphin # Observe confirmation # Disable confirmation # Repeat, observe no confirmation # Enable confirmation in the settings # Repeat, observe a confirmation Reviewers: #dolphin, markg, elvisangelaccio, rominf Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel, elvisangelaccio, markg, ngraham, rkflx, broulik, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D10960
2018-04-03Initialize m_konsolePartMissingMessageAntonio Rojas
Otherwise it just crashes when trying to open the terminal panel BUG: 392660 Differential Revision: https://phabricator.kde.org/D11904
2018-03-11Show a message if Konsole part is not installedRoman Inflianskas
Summary: Show a message if Konsole part is not installed BUG: 371822 FIXED-IN: 18.04.0 {F5749731} Reviewers: ngraham, progwolff, elvisangelaccio Reviewed By: ngraham, progwolff, elvisangelaccio Subscribers: rkflx, ngraham, elvisangelaccio, broulik, progwolff, #dolphin Differential Revision: https://phabricator.kde.org/D11118
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-02-11Fix Windows buildElvis Angelaccio
kill() is not available on Windows. Now that we build TerminalPanel everywhere (see 87e8d0ba), we need to #ifdef this call.
2018-02-11Fix typoElvis Angelaccio
GIT_SILENT
2018-01-18Set the focus to the active view, after leaving the terminal panelAdrián Chaves Fernández (Gallaecio)
Summary: BUG: 298467 Set the focus to the active view, after leaving the terminal panel. This is a fork of the patch at https://git.reviewboard.kde.org/r/116118/ by @emmanuelp which should fix the issue with the original patch reported by Frank Reininghaus. Test Plan: Works for me. Reviewers: #dolphin, emmanuelp, ngraham Reviewed By: #dolphin, ngraham Subscribers: ngraham, emmanuelp Differential Revision: https://phabricator.kde.org/D9955
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-10-12Don't block unmounting when terminal panel's cwd is the mountpointMiklos Marton
When unmounting a removable media Dolphin checks if there are some files open on the device before performing the unmount. If the terminal window in dolphin is open and the to be unmounted path is open, the unmount process will be blocked. This patch sets the terminal window current path to the home directory upon unmount request if the terminal directory is set to the mount path. The unmount request could came from two sources: The user could hit right click on the media in the dolphin's places panel and hit unmount. The user could request an unmount from the indicator applet This patch was originally written by Arjun AK for the kdelibs4 version of Dolphin: https://git.reviewboard.kde.org/r/121613/ BUG: 158264 FIXED-IN: 17.11.80 Differential Revision: https://phabricator.kde.org/D7847
2017-01-18Port away from deprecated KIO::Job::ui()Elvis Angelaccio
It's equivalent to KJob::uiDelegate() from kcoreaddons.
2016-03-16[CLAZY] Fixed all level 1 and level 2 warnings with small exceptionsArtur Puzio
REVIEW: 126771
2014-12-10Fix Terminal-View navigation sync issueArjun AK
The URL needs to be constructed from 'QUrl::fromLocalFile()' instead of a QString so that the scheme is set properly. REVIEW: 121409 BUG: 341678
2014-10-24Merge remote-tracking branch 'origin/master' into frameworksFrank Reininghaus
Conflicts: dolphin/src/panels/terminal/terminalpanel.cpp dolphin/src/panels/terminal/terminalpanel.h
2014-10-24Make the view/Terminal Panel synchronization less error-proneFrank Reininghaus
The previous solution could cause problems if the user navigates to a different URL in one view, and then activates another split view very quickly: the new active view might be switched to the same URL as the first view, which is unwanted. To fix this problem, we record a history of "cd" commands that Dolphin sends to the Terminal Panel in a queue. If a currentDirectoryChanged signal is received, and the new terminal directory is "dir", this patch does the following: 1. If the queue is empty, change the view URL to "dir". 2. Otherwise, take the queue's head, and check if it is equal to "dir". If that is the case, ignore the signal and return. 3. Go back to step 1. This ensures that every currentDirectoryChange signal that is caused by a "cd" that was sent from Dolphin to the terminal is ignored. BUG: 339009 BUG: 314038 REVIEW: 120768
2014-10-23Connect to the currentDirectoryChanged signal after the shell setupFrank Reininghaus
This fixes the problem that the view URL may be reset to the Home URL when opening the Terminal Panel while browsing a remote URL. Moreover, it fixes crashes that can occur when the signal is received during the shell setup if the DolphinMainWindow does not have a valid m_activeViewContainer yet. BUG: 339502 BUG: 340233 REVIEW: 120726 FIXED-IN: 4.14.3
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Fix includesMontel Laurent