worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

Thread panicked at vendor/skim-tuikit/src/input.rs, failed to get next char from input

Open daryllimyt opened this issue 6 months ago • 2 comments

version: 0.49.0 command: RUST_BACKTRACE=full wt switch os: macOS 26.4.1 Image

daryllimyt avatar May 12 '26 14:05 daryllimyt

Thanks for reporting this. I traced the panic to vendor/skim-tuikit/src/input.rs:143 — the input reader thread called next_char_timeout, fetch_bytes returned successfully, but the byte buffer was still empty, so string.chars().next().expect(...) panicked instead of returning a recoverable error. This looks like a transient race in the non-blocking TTY read path (e.g. select reports the fd ready but the subsequent read yields zero bytes) rather than something specific to wt switch logic — but I haven't been able to reproduce it locally.

To narrow it down, could you re-run with wt -vv switch? That writes a diagnostic report (.git/wt/logs/diagnostic.md) with wt/git/OS versions, shell-integration state, and a trace of every git invocation. The CLI prints a gh gist create --web <path> hint when it's done — pasting that gist URL here would give us a lot more context (terminal, shell, OS) about the environment where the panic fires.

A maintainer will also take a look.

(edited 2026-05-13: corrected a broken source link — the original used the wrong repo owner.)

worktrunk-bot avatar May 12 '26 15:05 worktrunk-bot

Update: the code path this panic came from no longer exists.

The panic fired inside the vendored skim-tuikit input-reader thread (vendor/skim-tuikit/src/input.rs, the string.chars().next().expect(...) site). That whole vendored fork was removed in #3137, which migrated the picker to skim 4.8 — a ratatui/crossterm-based rewrite with an entirely different (crossterm) input path. The specific expect() that panicked is gone, so this particular crash shouldn't be able to recur.

That change is on main now but not yet in a release — the latest published version is 0.60.0; it'll ship in the next one. Once it's out (or if you build from main), could you give wt switch another try? If it panics again, the new path would produce a different backtrace, so a fresh wt -vv switch diagnostic would help us trace it.

I'll leave this open for a maintainer to close once the fix is in a release.

worktrunk-bot avatar Jun 21 '26 08:06 worktrunk-bot