wish icon indicating copy to clipboard operation
wish copied to clipboard

fix: create a new pty for exec.Cmd

Open caarlos0 opened this issue 1 year ago • 1 comments

dirty fix to "inappropriate ioctl for device" on macOS.

It seems that macOS kills the slave pty once exec.Cmd finishes... so we need to create a new PTY just to run said program in order to avoid that problem.

Need to test, but this might make things possible on windows, too.

caarlos0 avatar Jan 23 '24 19:01 caarlos0

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (pty-command@1681ea4). Click here to learn what that means.

Additional details and impacted files
@@              Coverage Diff               @@
##             pty-command     #230   +/-   ##
==============================================
  Coverage               ?   77.23%           
==============================================
  Files                  ?       19           
  Lines                  ?      940           
  Branches               ?        0           
==============================================
  Hits                   ?      726           
  Misses                 ?      160           
  Partials               ?       54           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 24 '24 00:01 codecov[bot]

It "kinda" works on windows, but when the pty dies, so dies the parent process (the wish server).

Not sure if it is fixable...

caarlos0 avatar Jan 26 '24 10:01 caarlos0