mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
Set TERM=xterm-256color
This helps ensure a proper TERM value when running from e.g. systemd or VSCode's debugger. Fixes #5
This commit is contained in:
parent
d503d912f3
commit
11396d7877
@ -30,6 +30,8 @@ type LocalCommand struct {
|
|||||||
func New(command string, argv []string, options ...Option) (*LocalCommand, error) {
|
func New(command string, argv []string, options ...Option) (*LocalCommand, error) {
|
||||||
cmd := exec.Command(command, argv...)
|
cmd := exec.Command(command, argv...)
|
||||||
|
|
||||||
|
cmd.Env = append(os.Environ(), "TERM=xterm-256color")
|
||||||
|
|
||||||
pty, err := pty.Start(cmd)
|
pty, err := pty.Start(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// todo close cmd?
|
// todo close cmd?
|
||||||
|
Loading…
Reference in New Issue
Block a user