feat: Konsole parity phase 1 (save output, search options, monitors, profile CLI)
Implements the first batch of COSMIC_TERMINAL_KONSOLE_PARITY.md:
Save output as text:
- New SaveOutput action in the Edit menu, terminal context menu and
keyboard shortcuts (Ctrl+Shift+S, Konsole parity, rebindable).
- Terminal::scrollback_text() extracts history plus visible screen via
alacritty bounds_to_string, trimming trailing empty lines.
- Save-file dialog through cosmic-files; the file is written in a
spawn_blocking task so large scrollbacks never stall the UI.
Search options:
- Case-sensitive and regex checkboxes in the find bar.
- App::find_pattern() escapes the pattern when regex mode is off and
prefixes (?i) when case-insensitive (same approach as Alacritty).
Per-tab monitors (activity / silence / process finished):
- Toggles in the View menu and terminal context menu, state stored in
Terminal (monitor_* fields).
- Activity alerts on PTY output (Wakeup) for non-active tabs; silence
alerts after 10 s without output (Konsole default); process-finished
compares the shell pgrp with the tty tpgid via /proc/<pid>/stat and
alerts when the foreground job exits.
- Silence and process checks run on a 1 s iced::time subscription that
is only active while at least one tab needs it.
- Tab bar shows an armed icon (view-reveal-symbolic) and per-kind alert
icons; activating the tab acknowledges the alert.
Profile CLI:
- --profile/-p <name-or-id> applies a profile to the first tab only,
unknown profiles exit(1) with the available list on stderr.
- --list-profiles prints "id<TAB>name" and exits.
- Config is now loaded before the daemonize fork so CLI output reaches
the launching terminal.
- --help now documents -e/--command, --no-daemon and the new flags
(-e already worked; audit confirmed everything after it becomes the
command and its arguments).
i18n: new en/fr strings (save-output, monitor-*, find-case-sensitive,
find-regex).
Validated with ./check_cosmic_local.sh terminal, cargo fmt, and a debug
build exercising the CLI flags and a 6 s live run. The shutdown panic
in iced_winit ("async fn resumed after completion") pre-exists and is
reproducible with the installed binary.
Leyoda 2026 – GPLv3
This commit is contained in:
parent
5af952d285
commit
43d38aed8a
6 changed files with 529 additions and 42 deletions
|
|
@ -72,6 +72,7 @@ pub enum KeyBindAction {
|
|||
PastePrimary,
|
||||
#[cfg_attr(not(feature = "password_manager"), allow(dead_code))]
|
||||
PasswordManager,
|
||||
SaveOutput,
|
||||
SelectAll,
|
||||
Settings,
|
||||
TabActivate0,
|
||||
|
|
@ -113,6 +114,7 @@ impl KeyBindAction {
|
|||
Self::PaneToggleMaximized => Some(Action::PaneToggleMaximized),
|
||||
Self::Paste => Some(Action::Paste),
|
||||
Self::PastePrimary => Some(Action::PastePrimary),
|
||||
Self::SaveOutput => Some(Action::SaveOutput),
|
||||
Self::SelectAll => Some(Action::SelectAll),
|
||||
Self::Settings => Some(Action::Settings),
|
||||
Self::TabActivate0 => Some(Action::TabActivate0),
|
||||
|
|
@ -275,6 +277,7 @@ pub fn action_label(action: KeyBindAction) -> String {
|
|||
KeyBindAction::Paste => fl!("paste"),
|
||||
KeyBindAction::PastePrimary => fl!("paste-primary"),
|
||||
KeyBindAction::PasswordManager => fl!("password-manager"),
|
||||
KeyBindAction::SaveOutput => fl!("save-output"),
|
||||
KeyBindAction::SelectAll => fl!("select-all"),
|
||||
KeyBindAction::Settings => fl!("settings"),
|
||||
KeyBindAction::TabActivate0 => fl!("tab-activate", number = 1),
|
||||
|
|
@ -366,7 +369,7 @@ pub fn shortcut_groups() -> Vec<ShortcutGroup> {
|
|||
KeyBindAction::ZoomReset,
|
||||
],
|
||||
});
|
||||
let mut other_actions = vec![KeyBindAction::ClearScrollback];
|
||||
let mut other_actions = vec![KeyBindAction::ClearScrollback, KeyBindAction::SaveOutput];
|
||||
#[cfg(feature = "password_manager")]
|
||||
other_actions.push(KeyBindAction::PasswordManager);
|
||||
groups.push(ShortcutGroup {
|
||||
|
|
@ -459,6 +462,7 @@ fn fallback_shortcuts() -> Shortcuts {
|
|||
bind!([Shift], "Insert", PastePrimary);
|
||||
bind!([Ctrl, Shift], "W", TabClose);
|
||||
bind!([Ctrl, Shift], "R", TabRename);
|
||||
bind!([Ctrl, Shift], "S", SaveOutput);
|
||||
bind!([Ctrl], ",", Settings);
|
||||
bind!([], "F11", ToggleFullscreen);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue