Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: macOS pty race with dropped output#7278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 1 commit intomainfromspike/macos-pty-race
Apr 25, 2023

Conversation

@spikecurtis
Copy link
Contributor

No description provided.

Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtis changed the titleFix: macOS pty race with dropped outputfix: macOS pty race with dropped outputApr 25, 2023
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This seems fine, with a caveat.

Also, why can’t we have good things? 😄

iferr:=opty.tty.Close();err!=nil {
_=cmd.Process.Kill()
returnnil,nil,xerrors.Errorf("close tty: %w",err)
ifruntime.GOOS=="linux" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wonder if, down the line, this might give us a bad time trying to support other OSs (e.g. BSD variants).

I found a SO post that confirms Darwin like behavior on FreeBSD (8.2) as well, but apparently the behavior may be closer to Linux in 10.0 which could mean we may block on output copy.

https://stackoverflow.com/a/25123701

A comment mentions checkingtcgetattr on master to decide if we keep both ends open but no idea hire reliable that is:https://stackoverflow.com/questions/23458160/final-output-on-slave-pty-is-lost-if-it-was-not-closed-in-parent-why/25123701#comment36273878_23458160

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It definitely might!

But, the unit test we have should fail if the BSD version we intend to support acts like Linux and doesn't get the close, so I guess we'll just cross that bridge if we come to it.

mafredri reacted with thumbs up emoji
@spikecurtisspikecurtis merged commit6e8ff2d intomainApr 25, 2023
@spikecurtisspikecurtis deleted the spike/macos-pty-race branchApril 25, 2023 08:32
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 25, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@spikecurtisspikecurtis

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@spikecurtis@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp