Skip to content

Commit

Permalink
dysable syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Mar 5, 2025
1 parent e5c9dec commit 3622831
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"slices"
"strings"
"sync"
"syscall"
"unsafe"

_ "embed"

Expand Down Expand Up @@ -273,7 +271,7 @@ func NewCmdUp() *cobra.Command {
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, "SMALLWEB_DISABLE_PLUGINS=true")

ptyReq, winCh, isPty := sess.Pty()
ptyReq, _, isPty := sess.Pty()
if isPty {
cmd.Env = append(cmd.Env, fmt.Sprintf("TERM=%s", ptyReq.Term))
f, err := pty.Start(cmd)
Expand All @@ -282,12 +280,12 @@ func NewCmdUp() *cobra.Command {
sess.Exit(1)
return
}
go func() {
for win := range winCh {
syscall.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(syscall.TIOCSWINSZ),
uintptr(unsafe.Pointer(&struct{ h, w, x, y uint16 }{uint16(win.Height), uint16(win.Width), 0, 0})))
}
}()
// go func() {
// for win := range winCh {
// syscall.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(syscall.TIOCSWINSZ),
// uintptr(unsafe.Pointer(&struct{ h, w, x, y uint16 }{uint16(win.Height), uint16(win.Width), 0, 0})))
// }
// }()
go func() {
io.Copy(f, sess)
}()
Expand Down

0 comments on commit 3622831

Please sign in to comment.