Skip to main content

turbo_debug_console/
cmd.rs

1// Copyright (c) 2026 Enzo Lombardi
2// SPDX-License-Identifier: MIT
3
4//! Application command ids.
5//!
6//! Turbo Vision reserves the low range for built-ins (`CM_QUIT`, `CM_CLOSE`,
7//! `CM_TILE`, ...). These start at 1000 to stay clear of them.
8
9use turbo_vision::core::command::CommandId;
10
11/// File > Open capture...
12pub const CM_OPEN_CAPTURE: CommandId = 1000;
13/// File > Save As...
14pub const CM_SAVE_AS: CommandId = 1001;
15/// Edit > Clear window
16pub const CM_CLEAR_WINDOW: CommandId = 1004;
17/// Edit > Copy (copies the current selection to the clipboard)
18pub const CM_COPY: CommandId = 1002;
19/// Edit > Select All (selects the whole scrollback)
20pub const CM_SELECT_ALL: CommandId = 1003;
21/// Window > Cleanup (closes every disconnected window)
22pub const CM_CLEANUP: CommandId = 1005;
23/// Window > Tile (an app-owned id — see `CM_CASCADE_WINDOWS`)
24pub const CM_TILE_WINDOWS: CommandId = 1006;
25/// Window > Cascade.
26///
27/// Deliberately *not* Turbo Vision's own `CM_TILE` / `CM_CASCADE`:
28/// `Application::idle()` re-enables those two ids whenever the desktop holds
29/// any tileable window at all, and it runs inside `Application::get_event`
30/// on every poll timeout — so an app-level "only with more than one window"
31/// rule applied to the library ids is overwritten milliseconds later. These
32/// ids are ours alone; nothing else touches their enabled state, and
33/// `Console::handle_command` maps them onto `Application::tile` / `cascade`.
34pub const CM_CASCADE_WINDOWS: CommandId = 1007;
35
36/// Window > Auto-cleanup (a flag: close each window as its client goes away)
37pub const CM_AUTO_CLEANUP: CommandId = 1008;