Add xterm
This commit is contained in:
4
main.go
4
main.go
@@ -95,7 +95,7 @@ func handleConn(conn net.Conn, config *ssh.ServerConfig) {
|
|||||||
func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) {
|
func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) {
|
||||||
defer channel.Close()
|
defer channel.Close()
|
||||||
var ptmx *os.File
|
var ptmx *os.File
|
||||||
var termWidth, termHeight uint32 = 15, 15
|
var termWidth, termHeight uint32 = 80, 24
|
||||||
for req := range requests {
|
for req := range requests {
|
||||||
switch req.Type {
|
switch req.Type {
|
||||||
case "pty-req":
|
case "pty-req":
|
||||||
@@ -130,7 +130,7 @@ func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) {
|
|||||||
command = "/app/tui"
|
command = "/app/tui"
|
||||||
}
|
}
|
||||||
cmd := exec.Command(command)
|
cmd := exec.Command(command)
|
||||||
cmd.Env = []string{"PATH=/bin"}
|
cmd.Env = []string{"PATH=/bin", "TERM=xterm"}
|
||||||
cmd.Dir = "/"
|
cmd.Dir = "/"
|
||||||
var err error
|
var err error
|
||||||
ptmx, err = pty.Start(cmd)
|
ptmx, err = pty.Start(cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user