Skip to content

Enhance shlex parsing and add unit tests for POSIX and Windows#4898

Open
hanniavalera wants to merge 2 commits intomainfrom
dev/hanniavalera/compilefileterm
Open

Enhance shlex parsing and add unit tests for POSIX and Windows#4898
hanniavalera wants to merge 2 commits intomainfrom
dev/hanniavalera/compilefileterm

Conversation

@hanniavalera
Copy link
Copy Markdown
Contributor

This pull request addresses two main areas: it fixes the "Compile File" terminal closing too quickly (so users can see compilation output), and it significantly improves POSIX shell escape handling in the shlex parser, especially for escaped quotes. It also expands and clarifies tests to ensure correct shell parsing across platforms. This PR addresses #4896

Bug Fixes and User Experience Improvements

  • The "Compile File" terminal now remains open after compilation, displaying a prompt for the user to press any key to close it. This prevents output from being hidden and improves usability. [1] [2] [3] [4]

Shell Parsing and Escaping Improvements

  • The POSIX mode in shlex.split is now fully compliant with shell rules: backslash escapes are handled correctly outside and inside quotes, and escaped quotes (e.g., \") are interpreted as literal quotes when parsing compile commands. [1] [2] [3] [4] [5] [6]

Testing Enhancements

  • Added comprehensive unit tests for both Windows and POSIX shell parsing, covering edge cases such as escaped quotes, line continuations, and mixed quoting. These tests ensure robust cross-platform parsing and prevent regressions. [1] [2] [3]

Documentation

  • Improved documentation for the shlex.split function, clarifying how escaping and quoting are handled in different modes.

@hanniavalera hanniavalera linked an issue Apr 21, 2026 that may be closed by this pull request
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.

[Bug] Compile File terminal closes immediately

1 participant