Skip to content

Commit 1dac5cf

Browse files
ozankasikciclaude
andcommitted
Fix terminal size query in handle_enter for test environments
The CI tests were failing because handle_enter() was using crossterm::terminal::size() which throws errors in test environments where TestBackend doesn't support terminal size queries. Changed to use self.terminal.size().unwrap_or(24) to match the graceful fallback pattern used in handle_create_key(), providing a reasonable default height when the terminal size cannot be queried. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fccf175 commit 1dac5cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/interactive/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ where
313313
Focus::GlobalActions => match self.global_action_selected {
314314
0 => {
315315
// Check minimum terminal height before opening create dialog
316-
let (_, height) = crossterm::terminal::size()
317-
.wrap_err("failed to query terminal size")?;
316+
// In test environments, use terminal.size() for consistency
317+
let height = self.terminal.size().map(|size| size.height).unwrap_or(24);
318318

319319
if height < 15 {
320320
self.status = Some(StatusMessage::error(

0 commit comments

Comments
 (0)