Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
dev: fix not being able to click on dead processes
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Sep 16, 2024
1 parent e469008 commit c6490aa
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cmd/sst/mosaic/multiplexer/multiplexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,24 @@ func (s *Multiplexer) Start() {
}
if evt.Buttons()&tcell.ButtonPrimary != 0 {
x, y := evt.Position()
if x < SIDEBAR_WIDTH && y < len(s.processes) && !s.dragging {
if x < SIDEBAR_WIDTH && !s.dragging {
alive := 0
for _, p := range s.processes {
if !p.dead {
alive++
}
}
if alive != len(s.processes) {
if y == alive {
return
}
if y > alive {
y--
}
}
if y >= len(s.processes) {
return
}
s.selected = y
s.blur()
return
Expand Down

0 comments on commit c6490aa

Please sign in to comment.