Skip to content

Keyboard layouts: Norton Commander (default), Total Commander, Rust Commander - #39

Merged
bobnautic merged 2 commits into
mainfrom
claude/fervent-galileo-ft42tu
Nov 19, 2026
Merged

bobnautic merged 2 commits into
mainfrom
claude/fervent-galileo-ft42tu

Conversation

@bobnautic

Copy link
Copy Markdown
Owner

Summary

Feature request: Rust Commander offers keyboard layouts, with the original Norton Commander layout as the default and Total Commander as an alternative. The previous layout stays selectable as Rust Commander.

Layouts

Norton Commander (default) Total Commander
F1–F10 Help · Menu (user menu = custom commands) · View · Edit · Copy · RenMov · Mkdir · Delete · PullDn (menu bar) · Quit Help · Reread · View · Edit · Copy · Move · Mkdir · Delete · Menu · Menu
Shift F4 new file, F6 rename, F8 delete permanently F2 compare dirs, F4 new file, F6 rename, F8/Del delete permanently
Alt F1/F2 drive (session) left/right, F3 View.., F4 Edit.., F5 Pack, F6 UnPack, F7 Find F1/F2 drive, F3 external viewer, F4 quit, F5 pack, F6/F9 unpack, F7 find, ↓ folder history
Ctrl F3–F6 sort name/type/date/size, O terminal ("user screen"), U swap panels, R reread, \ root, PgUp/PgDn F3–F6 sort, D hotlist, S quick filter, U swap, F/N connect, Shift+F disconnect, ←/→ dir to left/right panel, Num+/Num− select all/none
Quick search Alt+letter Ctrl+Alt+letter

Keys the originals leave free keep Rust Commander's extra functions (terminal, sync, Remote Explorer, fingerprints …); the help marks them with *. Functions the originals have and Rust Commander doesn't (DOS command line, info/quick-view panels, panels on/off, folder tabs) stay unassigned.

UI

  • Function key bar above the status bar (1Help 2Menu 3View …), switches to the Shift/Ctrl/Alt layer while a modifier is held, clickable; hidden on phones, toggle in View and Preferences.
  • Menus, toolbar tooltips, context menu and panel buttons show the keys of the active layout.
  • F1 list is generated from the active layout and can switch layouts directly.
  • Layout choice in View → Keyboard layout and Preferences → General.
  • Menus opened by keyboard (F9, Alt+F1/F2, Ctrl+D) give the focus back to the file list when closed.

Implementation

  • ui/src/lib/keymaps.ts – layouts as pure data + key-event helpers (unit-testable)
  • ui/src/actions/commands.ts – command registry (run, label, key bar label, availability)
  • ui/src/actions/shortcuts.ts – global handler now resolves keys through the active layout
  • Settings keymap (default "norton") and showKeyBar (default true) in settings.json; existing files without the fields get the defaults
  • core:window:allow-close capability so F10 / Alt+F4 can quit the desktop app (with confirmation, warns about unsaved editor changes)

Note: separate build fix

main doesn't compile since the merged Dependabot bump of x509-cert to 0.3 (TBS certificate fields became private). The first commit switches rc-core/src/protocols/tls.rs to the accessor methods; it's needed for this PR's CI.

Behaviour change

The default layout changes for existing users: e.g. F2 opens the user menu instead of renaming (rename: Shift+F6), F9 opens the menu bar instead of refreshing (Ctrl+R still works). Choosing the "Rust Commander" layout restores the old keys exactly (pinned by a unit test).

Test plan

  • npm run build (tsc + vite)
  • npm run test:unit: 19 tests, 7 new for the layouts (every combination canonical, NC/TC key bars and layers, old layout unchanged, quick search incl. macOS Option)
  • node tests/smoke.mjs: all steps pass; rename step updated to Shift+F6; new steps: NC key bar + Alt layer, F2 user menu, F9 menu + focus return, Alt+F2, Alt+letter search; TC via the View menu, Ctrl+D hotlist, Alt+↓ history, F1 list + switching back
  • cargo fmt --all --check, cargo clippy -p rc-core -p rc-api --all-targets -D warnings, cargo test -p rc-api (new test: settings without keymap default to Norton Commander)
  • Desktop app (Tauri) not built here (no webkit libraries in the container): please check F10/Alt+F4 quit and Alt+F-keys on Windows/macOS/Linux by hand

Generated by Claude Code

x509-cert 0.3 (Dependabot, merged) made the TBS certificate fields private;
use the accessor methods instead so rc-core compiles again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017w9FQmmTGCmcWdHRoM2wue
…ommander

Rust Commander now offers keyboard layouts. The default is the original
Norton Commander layout (1Help 2Menu 3View 4Edit 5Copy 6RenMov 7Mkdir
8Delete 9PullDn 10Quit, Alt+F1/F2 drive, Alt+F3-F7, Ctrl+F3-F6 sorting,
Ctrl+O, Ctrl+U, Alt+letter quick search). Total Commander's layout is
available too (F2 reread, Shift+F6 rename, Ctrl+D hotlist, Ctrl+S filter,
Alt+Down history, Ctrl+Left/Right, Ctrl+Alt+letter quick search), and the
previous layout stays selectable as "Rust Commander".

- lib/keymaps.ts: the layouts as pure data plus key-event helpers
- actions/commands.ts: command registry (run, labels, availability)
- function key bar above the status bar with Shift/Ctrl/Alt layers
- menus, toolbar, context menu and the F1 list follow the active layout
- setting "keymap" (default "norton") and "showKeyBar" in settings.json;
  View menu, Preferences and the F1 dialog switch the layout
- F10 / Alt+F4 quit the desktop app (with confirmation)
- unit and smoke tests, docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017w9FQmmTGCmcWdHRoM2wue
@bobnautic
bobnautic merged commit 61c5b36 into main Nov 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants