-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spin): preserve color output when
--show-output
is given (#850)
- Loading branch information
1 parent
a30c8bd
commit 93f6857
Showing
5 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package spin | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/charmbracelet/x/term" | ||
"github.com/charmbracelet/x/xpty" | ||
) | ||
|
||
func openPty(f *os.File) (pty xpty.Pty, err error) { | ||
width, height, err := term.GetSize(f.Fd()) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
pty, err = xpty.NewPty(width, height) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return pty, nil | ||
} |
This file contains 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