mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Add logging; don't relay signal from stub after seeing EOF.
This commit is contained in:
parent
e6c44bdbdd
commit
60ea1ffb35
|
@ -20,6 +20,7 @@ func (ed *Editor) appendHistory(line string) {
|
|||
// TODO(xiaq): Report possible error
|
||||
ed.store.AddCmd(line)
|
||||
ed.store.Waits.Done()
|
||||
Logger.Println("added cmd to store:", line)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -385,6 +385,7 @@ func cdInner(dir string, ec *EvalCtx) {
|
|||
// XXX Error ignored.
|
||||
store.AddDir(pwd)
|
||||
store.Waits.Done()
|
||||
Logger.Println("added dir to store:", pwd)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ type BadSignal struct {
|
|||
}
|
||||
|
||||
func (bs BadSignal) String() string {
|
||||
return "bad signal:" + bs.Error.Error()
|
||||
return "bad signal: " + bs.Error.Error()
|
||||
}
|
||||
|
||||
func (BadSignal) Signal() {}
|
||||
|
|
|
@ -122,6 +122,9 @@ func relaySignals(reader io.Reader, sigch chan<- os.Signal) {
|
|||
_, err := fmt.Fscanf(reader, "%d", &signum)
|
||||
if err != nil {
|
||||
sigch <- BadSignal{err}
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
} else {
|
||||
sigch <- syscall.Signal(signum)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user