Commit d5dd055
authored
fix: restore terminal state after video prompt timeout (#303)
## Summary
Fixes terminal being left in a broken state after t-rec completes when
the video generation prompt times out.
### Problem
When the video generation prompt times out (after 15 seconds of no
input), the dialoguer thread is abandoned while still waiting for input.
This leaves the terminal in a modified state (hidden cursor, raw mode),
requiring users to run `reset` to restore normal terminal behavior.
### Solution
Use `dialoguer::console::Term` to explicitly restore the terminal state
by calling `show_cursor()` after timeout. This ensures the cursor is
visible and the terminal behaves normally after t-rec exits.
## Test plan
- [x] Run `t-rec`, let the video prompt timeout (wait 15s) → terminal
should work normally after
- [x] Run `t-rec`, press `y` at video prompt → terminal should work
normally
- [x] Run `t-rec`, press `n` at video prompt → terminal should work
normally1 parent 0e0e1b0 commit d5dd055
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
| |||
0 commit comments