Commit Graph

147 Commits

Author SHA1 Message Date
Jack Xu
95c324615e Do not change auto save action visibility and title when auto save task failed to be spawned.
"Auto save output as" still became "Stop Autosave" when cancelling in file dialog.

Make SessionTask::execute return value that indicates the task has been spawned
successfully or not. So SessionController::autoSaveHistory could decide whether
to change the visibility of _startAutoSaveAction and _stopAutoSaveAction.

BUG: 507069
2025-09-11 02:01:19 +00:00
Waqar Ahmed
6d43440ca6 Fix processId() for flatpak
processId() was returning the pid of flatpak-spawn, while we want the
shell process id.

BUG: 509309
2025-09-10 13:53:24 +05:00
Wang Yu
4090703cf3 typo TopBotton to TopBottom in split view signals
Corrects the spelling of signal name from requestSplitViewTopBotton to
requestSplitViewTopBottom in ViewManager and SessionController.
2025-06-05 21:45:14 +08:00
Luca Carlon
0ce309e66b Avoid detaching Qt containers in range-based for loops
Using temporaries or non-const containers directly in range-based
loops can cause containers to detach, leading to unnecessary copies.
This commit ensures all range-based loops iterate over named,
const-qualified containers to prevent detachment and improve performance.
2025-05-18 16:48:32 +02:00
Luca Carlon
3256676a54 Ensure hamburger menu is in the popup menu when instance is re-created
This commit fixes an issue with the hamburger menu not appearing in the
context menu. This typically happens when you split the view multiple
times. This is particularly bothering because you cannot show the menu
when it is hidden.

BUG: 476557
2025-05-06 23:27:18 +00:00
owl from-hogvarts
ff6246f999 fix: disable copy action even when semantic integration is detected 2025-04-12 17:34:17 +00:00
Christoph Cullmann
c7e02ed876 port to QStringDecoder/Encoder 2025-02-27 20:31:47 +00:00
Ujjwal Shekhawat
e389807d55 Implement scrollbar highlighting for search results
This PR introduces a feature to highlight the position of search results on the scrollbar, similar to how search results are highlighted in browsers like Google Chrome, editors like VSCode. The aim is to provide users with a visual indicator on the scrollbar, helping them quickly navigate through the results. 

FEATURE: 302284
2025-02-20 01:14:40 +00:00
Blaise Duszynski
ab751a3b16 Add HamburgerMenu only once per instance
A new HamburgerMenu is added to the context menu each time it is opened
which causes a delay after enough invocations.  Skip adding another if
one has already been added.

BUG: 495029
2025-02-17 23:26:13 +00:00
Anthony Wang
152eba6e0c Fix typo in message for force-killing session 2025-01-31 14:54:40 -05:00
Deft Dawg
5c7ffaed34 Add Copy keyboard shortcut alternate bind to Ctrl+Ins
Adds `Ctrl+Insert` as a shortcut to `Copy`; this is an alternate keybinding to `Copy` that works across both KDE and Windows and doesn't conflict with `Ctrl+C` used to terminate terminal programs.
2024-12-31 19:58:07 +00:00
BZZZZ DZZZZ
1c3eaa8f15 Fix crashes with context menus
Also redraw tabs better when tab color changes


BUG: 492465
2024-11-06 00:09:25 +00:00
Ahmet Hakan Çelik
9c72d6301d Allow setting Konsole tab color with escape codes
FEATURE: 396960
2024-07-24 18:53:34 +00:00
Theodore Wang
ae222d8eb5 Added autosave functionality
The autosave functionality is contained in a SaveHistoryAutoTask
class, which inherits from SessionTask. The autosave mechanism
hinges on two pieces of information regarding the autosave file:
the number of bytes used to store the contents of dropped lines
(represented by SaveHistoryAutoTask::_droppedBytes) and a list
of byte offsets corresponding to the start of the contents of lines
on the screen (represented by SaveHistoryAutoTask::_bytesLines).
Everytime a line is dropped, SaveHistoryAutoTask::_droppedBytes
is updated using _bytesLines. Everytime the output is read and
saved to file, the autosave file is resized to _droppedBytes and
the current screen output is appended. Everytime the output is read
or the screen is resized, _bytesLines is updated.

The autosave can be started using an "Auto Save Ouput As" button in
the "File" tab of the toolbar. Once the autosave is started, said
button is replaced by a "Stop Auto Save" button which allows the
user to stop the autosave. Internally, any errors encountered by
the program would result in an KMessageBox reporting the details of
the error and stopping the autosave as well. Clicking on the stop
button reveals the start button again.

Similar to SaveHistoryTask, there is a file dialog which allows the
user to choose which file they would like the autosave contents to
be stored in.

Apart from errors involving reading session output and writing to
file, modifying the file externally, renaming the file and deleting
the file will also result in an error. Emulation::_currentScreen
being changed will also result in an error.

The autosave is conducted at a fixed time interval, apart from an
edge case where an autosave is required immediately due to internal
constraints. Said fixed time interval can be set by the user in the
settings of their current profile, specifically the "Advanced" tab.

Details on the internals of the autosave functionality is documented
in the source files.

GUI
FEATURE: 208620
2024-07-21 18:26:27 +00:00
João Gouveia
f1308b7077 Add "No wrap" setting to search options
In some scenarios, users don't want to start a search again from the
top when they reach the end of the contents being searched. However,
if the contents are too large, it can be difficult to notice when
such jumping occurs. This commit aims to address this by adding an
option that disables the automatic wrapping in searches.

FEATURE: 303485
2024-04-13 00:18:44 +00:00
Matan Ziv-Av
61a87d8048 Add next/previous actions to change the profile of the current terminal
The actions are not in any menu, but have default keyboard shortcuts:
Ctrl-Alt-N (next) and Ctrl-Alt-M (previous).

BUG: 413258
2024-03-28 22:14:00 +00:00
Julius Künzel
61264c1917 Fix compile error on macOS 2024-02-25 05:33:15 +00:00
Adam Hill
1668525461 Fix View menu title case and add icon for mouse tracking
This merge request fixes the title case for three entries in the view menu
- One-Shot Monitors
- Read-Only
- Allow Mouse Tracking

and adds the icon "input-mouse-symbolic" for the Allow Mouse Tracking entry


![Screenshot_20240122_191357](/uploads/2f4b5b35a2063453f3d3a818ac023658/Screenshot_20240122_191357.png)
2024-01-23 16:02:10 +00:00
Antonio Rojas
73970f7105 Support Arch Linux names for the lrzsz executables 2024-01-13 21:27:37 +00:00
Theodore Wang
cd2330c4fc Implemented DBus methods for copying input to other sessions
Implemented methods which allow input to be copied to no other
session and to all sessions. In addition, users can also select
exactly which sessions to copy input to by passing a list of
Session ids. Calling supporting method copyingSessions() on a
session lists other sessions which are copying input from it.
Calling supporting method feederSessions() on a session lists
other sessions it is copying input from.

BUG: 307089
2023-12-27 20:27:56 +00:00
Petr Vanek
77755fc0cc Apply split view icons to the session context menu too. 2023-11-21 09:19:37 +00:00
Laurent Montel
1abfaaf561 GIT_SILENT: adapt to new api 2023-11-09 06:50:52 +01:00
Nicolas Fella
ccefad2839 Port to new KNotifications action API 2023-11-04 16:26:43 +00:00
Laurent Montel
a751faf02a Remove unused now qt5 code. Master is qt6 only now 2023-10-27 06:34:56 +00:00
Waqar Ahmed
1e136d63f2 move konsole to kf6 2023-10-25 22:13:53 +05:00
Friedrich W. H. Kossebau
c11a3f668e Adapt to change of KStandardAction::name(id) return type
GIT_SILENT
2023-10-24 02:21:53 +02:00
Kurt Hindenburg
5bda57405e Fix crashes in testTerminalInterface
Certain user profiles crash here

   from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
    this=0x5555557c8da0, name=..., visible=true)
    at src/konsole/src/session/SessionController.cpp:2206
    mode=1) at src/konsole/src/Screen.cpp:2395
    at src/konsole/src/Vt102Emulation.cpp:1071
    this=0x555555dc2a30, cc=7)
2023-08-18 20:14:16 -04:00
Nicolas Fella
f3a9066dd5 Port away from KNotification::CloseWhenWidgetActivated 2023-08-17 19:45:37 +00:00
Friedrich W. H. Kossebau
451ed33d63 Add explicit moc includes to sources for moc-covered headers
* 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-07-28 12:17:12 +00:00
Theodore Wang
09237ee02f Fixed search bar false positive after clear scrollback (and reset)
To prevent the search bar from continuing to show a match by emitting
green even after clearing scrollback and resetting, search is rerun
whenever the searchbar is opened.

BUG: 407317
2023-06-16 17:10:58 +00:00
Tobias Fella
53d473cff3 Port to KF6 2023-05-29 16:17:23 +00:00
Matan Ziv-Av
b69a2b88ef Add a menu option for monitors to only notify once.
When this option is enabled, the monitors (prompt, activity, silence,
process termination) are disabled automatically after one notification.
2023-05-14 14:15:19 +00:00
Matan Ziv-Av
542a04560d Add "Monitor for Prompt" action
When semantic shell integration is enabled, Konsole will generate a
notification when a shell prompt is displayed.
2023-05-14 14:15:19 +00:00
Luis Javier Merino
6466523141 Use correct kcmshellX for QtX version - Fix typo in d962ae00c 2023-03-27 21:19:23 +00:00
Laurent Montel
d962ae00c3 Use kcmshell6 on kf6 2023-03-26 20:43:39 +02:00
Waqar Ahmed
703e1c0747 Use userTitle on windows for tabTitle
Otherwise its just ": -"
2023-03-09 11:16:35 +05:00
Waqar Ahmed
efb1686e62 Make konsole compile on windows 2023-03-09 11:16:35 +05:00
Magno Lomardo
d3fa26f65b Add the context menu options to split the view left-right and top-bottom
FEATURE: 415724
2023-03-06 22:41:41 +00:00
Matan Ziv-Av
60a534a2e7 codecNameTrigger's parameter is a QString, not QByteArray. 2023-02-26 12:28:35 +00:00
Matan Ziv-Av
0717268d03 Fix a typo in e98a6a19ff
the cases for version >= 5.103 and < 5.103 are reversed
2023-02-26 12:28:35 +00:00
Nicolas Fella
e98a6a19ff Port away from deprecated KCodecAction API 2023-02-24 01:05:24 +00:00
Matan Ziv-Av
7f6f2c1cea Make keyboard selection mode independent of read only mode 2023-02-24 00:18:16 +00:00
Matan Ziv-Av
0375b56d74 Allow pressing Esc to quit keyboard selection mode 2023-02-24 00:18:16 +00:00
Waqar Ahmed
0a78bfe4ac Fix inconsistent dll linkage errors and warnings on windows 2023-02-23 23:53:26 +00:00
Nicolas Fella
f51caadf3e Fix applying default encoding from KCodecAction
Currently selecting 'Default' in the codec selector doesn't do anything

Connect to the relevant signal and apply the profile's default encoding
2023-01-02 14:52:16 +00:00
Aleix Pol
d3c36c3419 Fix crash using yakuake
The hamburger menu seems to be null.

```
/home/apol/devel/frameworks/kconfigwidgets/src/khamburgermenu.h:97
menu=0x5580261dbe80) at
/home/apol/devel/frameworks/kconfigwidgets/src/khamburgermenu.cpp:109
Konsole::SessionController::showDisplayContextMenu (this=0x558025dfa2d0,
position=...) at
/home/apol/devel/frameworks/konsole/src/session/SessionController.cpp:1990
QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QPoint
const&>, void, void (Konsole::SessionController::*)(QPoint
const&)>::call (f=(void
(Konsole::SessionController::*)(Konsole::SessionController * const,
const QPoint &)) 0x7f728c8a1920
<Konsole::SessionController::showDisplayContextMenu(QPoint const&)>,
o=0x558025dfa2d0, arg=0x7ffdb36086c0) at
/home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:152
```
2022-12-04 08:06:39 +00:00
Andrey Butirsky
b8325d2f18 fixup! Adopt KHamburgerMenu 2022-11-29 23:03:54 +04:00
Nate Graham
b04265e9fa Adopt KHamburgerMenu
It's amazing!

BUG: 439895
FIXED-IN: 23.04
2022-11-29 23:03:54 +04:00
Friedrich W. H. Kossebau
3213a17798 Port away from deprecated KMessageBox Yes/No API
Using "Yes" & "No" text labels on dialog buttons is discouraged by not
only the KDE HIG these days. Yet the legacy API of KMessageBox was
using Yes & No as terms in its API, conflicting with what the HIG
recommends and trapping HIG-unaware developers into thinking to use
Yes & No buttons.

New substitute API uses the term "action" instead, matching the concept
proposed by the KDE HIG.

GIT_SILENT
2022-10-16 04:11:14 +00:00
Matan Ziv-Av
f26f71db01 Add keyboard selection mode
Similar to screen copy/scrollback mode it allows browsing the scrollback
and selecting text.

Selection is done either by standard GUI shift+arrows, or `vi` style with
`v` starting/ending selection.

BUG: 100317
2022-10-03 10:46:46 +00:00