mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-23 02:51:26 +01:00
export PROMPT and PROMPT_VERSION, always start remote
This commit is contained in:
parent
f8c675c3e7
commit
5914e57afc
@ -902,7 +902,7 @@ func RemoteNewCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (ss
|
||||
if editArgs.Color != "" {
|
||||
r.RemoteOpts = &sstore.RemoteOptsType{Color: editArgs.Color}
|
||||
}
|
||||
err = remote.AddRemote(ctx, r)
|
||||
err = remote.AddRemote(ctx, r, true)
|
||||
if err != nil {
|
||||
return makeRemoteEditErrorReturn_new(visualEdit, fmt.Errorf("cannot create remote %q: %v", r.RemoteCanonicalName, err))
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ func ReadRemotePty(ctx context.Context, remoteId string) (int64, []byte, error)
|
||||
return offset, barr, nil
|
||||
}
|
||||
|
||||
func AddRemote(ctx context.Context, r *sstore.RemoteType) error {
|
||||
func AddRemote(ctx context.Context, r *sstore.RemoteType, shouldStart bool) error {
|
||||
GlobalStore.Lock.Lock()
|
||||
defer GlobalStore.Lock.Unlock()
|
||||
|
||||
@ -306,7 +306,7 @@ func AddRemote(ctx context.Context, r *sstore.RemoteType) error {
|
||||
newMsh := MakeMShell(r)
|
||||
GlobalStore.Map[r.RemoteId] = newMsh
|
||||
go newMsh.NotifyRemoteUpdate()
|
||||
if r.ConnectMode == sstore.ConnectModeStartup {
|
||||
if shouldStart {
|
||||
go newMsh.Launch()
|
||||
}
|
||||
return nil
|
||||
@ -988,8 +988,8 @@ func addScVarsToState(state *packet.ShellState) *packet.ShellState {
|
||||
}
|
||||
rtn := *state
|
||||
envMap := shexec.DeclMapFromState(&rtn)
|
||||
envMap["PROMPT"] = &shexec.DeclareDeclType{Name: "PROMPT", Value: "1"}
|
||||
envMap["PROMPT_VERSION"] = &shexec.DeclareDeclType{Name: "PROMPT_VERSION", Value: scbase.PromptVersion}
|
||||
envMap["PROMPT"] = &shexec.DeclareDeclType{Name: "PROMPT", Value: "1", Args: "x"}
|
||||
envMap["PROMPT_VERSION"] = &shexec.DeclareDeclType{Name: "PROMPT_VERSION", Value: scbase.PromptVersion, Args: "x"}
|
||||
rtn.ShellVars = shexec.SerializeDeclMap(envMap)
|
||||
return &rtn
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user