Skip to content

Change syntax error handling from Exit to Continue#282

Merged
wolfv merged 1 commit intomainfrom
claude/fix-shell-parser-error-LeYMF
Mar 21, 2026
Merged

Change syntax error handling from Exit to Continue#282
wolfv merged 1 commit intomainfrom
claude/fix-shell-parser-error-LeYMF

Conversation

@wolfv
Copy link
Member

@wolfv wolfv commented Mar 21, 2026

Summary

Modified the error handling behavior when a syntax error occurs during shell execution. Instead of immediately exiting with status code 1, the shell now continues execution while still returning the error code.

Key Changes

  • Changed ExecuteResult::Exit(1, vec![], vec![]) to ExecuteResult::Continue(1, vec![], vec![]) in the syntax error handler
  • This allows the shell to continue processing after encountering a syntax error rather than terminating immediately

Implementation Details

The change affects the error path in execute_inner() when a syntax error is caught during parsing. The exit code (1) and empty output vectors are preserved, maintaining the error signal while changing the control flow behavior to continue rather than exit.

https://claude.ai/code/session_01FWuvp3gzrVXafUFScojkFZ

Parser errors returned ExecuteResult::Exit which caused the interactive
loop to call std::process::exit(). Changed to ExecuteResult::Continue so
the shell shows the error and returns to the prompt instead of exiting.

https://claude.ai/code/session_01FWuvp3gzrVXafUFScojkFZ
@wolfv wolfv merged commit 665441b into main Mar 21, 2026
8 checks passed
@wolfv wolfv deleted the claude/fix-shell-parser-error-LeYMF branch March 21, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants