Skip to content

Fix TUI crash when clicking past end of log line#805

Merged
brody192 merged 1 commit intorailwayapp:masterfrom
ryanmarshallmc:bug-fix/mouse-event-past-end-of-line
Feb 27, 2026
Merged

Fix TUI crash when clicking past end of log line#805
brody192 merged 1 commit intorailwayapp:masterfrom
ryanmarshallmc:bug-fix/mouse-event-past-end-of-line

Conversation

@ryanmarshallmc
Copy link
Contributor

Summary

  • Fixes a panic in the TUI (railway dev) when clicking in the terminal beyond the end of a log line's actual characters
  • The crash was caused by sel_start (derived from mouse click column) not being clamped to the line length, leading to an out-of-bounds slice index in render_log_line
  • Adds .min(line_len) to clamp sel_start, matching the existing clamping already done for sel_end

Error before fix

thread 'main' panicked at src/controllers/develop/tui/ui.rs:230:41:
range end index 49 out of range for slice of length 12

Test plan

  • cargo build passes
  • cargo test passes

Made with Cursor

@brody192 brody192 added release/patch Author patch release release/skip Author no release and removed release/patch Author patch release labels Feb 27, 2026
@brody192 brody192 merged commit 72c5201 into railwayapp:master Feb 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/skip Author no release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants