Repository navigation
PTY-based terminal - #7
Open
Yan123-tech wants to merge 1 commit into
Open
Yan123-tech wants to merge 1 commit into
Yan123-tech wants to merge 1 commit into
Conversation
Refs #5. Replace the pipe-based shell with a real pseudo-terminal so interactive programs render and Ctrl-C reaches the foreground process group. Plan, per the issue: - open a PTY via posix_openpt/grantpt/unlockpt and replace the three pipes in TerminalSession - parse at least CR, BS, LF and ANSI SGR so ls --color and git diff render, behind a protocol so the parser stays unit-testable - send TIOCSWINSZ on panel resize - forward SIGINT to the foreground process group instead of writing 0x03 to a pipe the shell does not read as a signal Keeping the existing pipe implementation as the fallback until the PTY path is verified against an interactive program.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #5. Placeholder branch for the PTY rewrite of
TerminalSession. No code yet — the commit is a plan so the work has a home.Motivation
TerminalSessionspawns$SHELL -ioverPipe()s. That gives no job control, no terminal echo, and no TTY-aware behaviour:topexits immediately,vimrenders wrong, and Ctrl-C writes0x03into a pipe the shell does not interpret as a signal.Proposed approach
posix_openpt→grantpt→unlockpt→ptsname).TIOCSWINSZon panel resize.SIGINTto the foreground process group.Testing
swift buildpassesswift testpassesvimandtoprenderls --colorshows colourStatus
Not started. Follow-up commits land here.