mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-11-28 15:31:20 +08:00
Client: Give up terminal until external state change.
It's now possible to run `cat` and `vim` from `das`! dasc's response handling is currently very adhoc, though.
This commit is contained in:
parent
d00be693b0
commit
89517efc66
|
@ -93,9 +93,17 @@ func main() {
|
||||||
req.Write(json)
|
req.Write(json)
|
||||||
req.WriteString("\n")
|
req.WriteString("\n")
|
||||||
|
|
||||||
msg, err := res.ReadBytes('\n')
|
for {
|
||||||
if err == nil {
|
msg, err := res.ReadString('\n')
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("broken response pipe, quitting")
|
||||||
|
os.Exit(1)
|
||||||
|
} else {
|
||||||
fmt.Printf("response: %s", msg)
|
fmt.Printf("response: %s", msg)
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(msg, "external") {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user