force our exit trap to always run (for rtnstate commands) (#556)

* add command validation to shellapi.  mock out bash/zsh versions

* implement validate command fn bash and zsh

* test validate command

* change rtnstate commands to always end with a builtin, so we always get our exit trap to run

* simplify the rtnstate modification, don't add the 'wait' (as this is a different problem/feature)

* update schema
This commit is contained in:
Mike Sawka
2024-04-09 11:33:23 -07:00
committed by GitHub
parent 1f5309e097
commit 6919dbfb5f
10 changed files with 145 additions and 49 deletions
+1 -1
View File
@@ -1735,7 +1735,7 @@ func (msh *MShellProc) Launch(interactive bool) {
msh.WriteToPtyBuffer("connected to %s\n", remoteCopy.RemoteCanonicalName)
go func() {
exitErr := cproc.Cmd.Wait()
exitCode := shexec.GetExitCode(exitErr)
exitCode := utilfn.GetExitCode(exitErr)
msh.WithLock(func() {
if msh.Status == StatusConnected || msh.Status == StatusConnecting {
msh.Status = StatusDisconnected