detached 48f527b

fix(preflight): remove keyboard layout auto-detection

- Remove detectEnvironment() and detectKeymap() functions
- Remove keyboard detection from preflight Execute phase
- Keyboard layout now defaults to 'us' in form, user can override
- No programmatic method exists to detect loadkeys-set keyboard state
commit
48f527b1bffcbc820ef1e27ae4b84769ffed71d1
author
bnema · · 2025-10-26 21:32 UTC
parent
ea9cd09
signature
unsigned
1 file · +1 -45
M internal/phases/preflight.go +1 -45
@@ -73,13 +73,10 @@ func (p *PreflightPhase) PreCheck() error {
7373 func (p *PreflightPhase) Execute(progressChan chan<- ProgressUpdate) PhaseResult {
7474 p.SendProgress(progressChan, "Running preflight checks...", 1, 2)
7575
76- // Detect environment
77- p.detectEnvironment(progressChan)
78-
7976 // Set defaults
8077 p.SetDefaults()
8178
82- p.SendProgress(progressChan, "Environment detected", 2, 2)
79+ p.SendProgress(progressChan, "Preflight checks complete", 2, 2)
8380 p.SendComplete(progressChan, "Preflight complete")
8481
8582 return PhaseResult{
@@ -88,47 +85,6 @@ func (p *PreflightPhase) Execute(progressChan chan<- ProgressUpdate) PhaseResult
8885 }
8986 }
9087
91-// detectEnvironment auto-detects keyboard layout and network
92-func (p *PreflightPhase) detectEnvironment(progressChan chan<- ProgressUpdate) {
93- p.SendOutput(progressChan, "Detecting keyboard layout...")
94-
95- keymap := p.detectKeymap()
96- p.config.Keymap = keymap
97- p.SendOutput(progressChan, fmt.Sprintf("[OK] Keyboard layout: %s", keymap))
98-}
99-
100-// detectKeymap detects current keyboard layout
101-func (p *PreflightPhase) detectKeymap() string {
102- out, err := exec.Command("localectl", "status").Output()
103-
104- switch {
105- case err != nil:
106- return "us" // Default fallback
107- }
108-
109- lines := strings.Split(string(out), "\n")
110- for _, line := range lines {
111- if !strings.Contains(line, "VC Keymap") {
112- continue
113- }
114-
115- parts := strings.Fields(line)
116- if len(parts) < 3 {
117- continue
118- }
119-
120- keymap := parts[2]
121- switch keymap {
122- case "(unset)", "":
123- return "us"
124- default:
125- return keymap
126- }
127- }
128-
129- return "us"
130-}
131-
13288 // SetDefaults sets default configuration values
13389 func (p *PreflightPhase) SetDefaults() {
13490 switch {
@@ -73,13 +73,10 @@ func (p *PreflightPhase) PreCheck() error {
73 func (p *PreflightPhase) Execute(progressChan chan<- ProgressUpdate) PhaseResult {73 func (p *PreflightPhase) Execute(progressChan chan<- ProgressUpdate) PhaseResult {
74 p.SendProgress(progressChan, "Running preflight checks...", 1, 2)74 p.SendProgress(progressChan, "Running preflight checks...", 1, 2)
75 75
76- // Detect environment
77- p.detectEnvironment(progressChan)
78-
79 // Set defaults76 // Set defaults
80 p.SetDefaults()77 p.SetDefaults()
81 78
82- p.SendProgress(progressChan, "Environment detected", 2, 2)79+ p.SendProgress(progressChan, "Preflight checks complete", 2, 2)
83 p.SendComplete(progressChan, "Preflight complete")80 p.SendComplete(progressChan, "Preflight complete")
84 81
85 return PhaseResult{82 return PhaseResult{
@@ -88,47 +85,6 @@ func (p *PreflightPhase) Execute(progressChan chan<- ProgressUpdate) PhaseResult
88 }85 }
89 }86 }
90 87
91-// detectEnvironment auto-detects keyboard layout and network
92-func (p *PreflightPhase) detectEnvironment(progressChan chan<- ProgressUpdate) {
93- p.SendOutput(progressChan, "Detecting keyboard layout...")
94-
95- keymap := p.detectKeymap()
96- p.config.Keymap = keymap
97- p.SendOutput(progressChan, fmt.Sprintf("[OK] Keyboard layout: %s", keymap))
98-}
99-
100-// detectKeymap detects current keyboard layout
101-func (p *PreflightPhase) detectKeymap() string {
102- out, err := exec.Command("localectl", "status").Output()
103-
104- switch {
105- case err != nil:
106- return "us" // Default fallback
107- }
108-
109- lines := strings.Split(string(out), "\n")
110- for _, line := range lines {
111- if !strings.Contains(line, "VC Keymap") {
112- continue
113- }
114-
115- parts := strings.Fields(line)
116- if len(parts) < 3 {
117- continue
118- }
119-
120- keymap := parts[2]
121- switch keymap {
122- case "(unset)", "":
123- return "us"
124- default:
125- return keymap
126- }
127- }
128-
129- return "us"
130-}
131-
132 // SetDefaults sets default configuration values88 // SetDefaults sets default configuration values
133 func (p *PreflightPhase) SetDefaults() {89 func (p *PreflightPhase) SetDefaults() {
134 switch {90 switch {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close