sync shell state when you switch to a new tab

This commit is contained in:
sawka 2024-03-13 11:57:49 -07:00
parent 4b5eccab7c
commit 9c32f690c6
3 changed files with 8 additions and 1 deletions

View File

@ -304,6 +304,10 @@ class CommandRunner {
GlobalModel.clientSettingsViewModel.showClientSettingsView();
}
syncShellState() {
GlobalModel.submitCommand("sync", null, null, { nohist: "1" }, false);
}
historyView(params: HistorySearchParams) {
let kwargs = { nohist: "1" };
kwargs["offset"] = String(params.offset);

View File

@ -1086,6 +1086,9 @@ class Model {
this.activeMainView.set("session");
this.deactivateScreenLines();
this.ws.watchScreen(newActiveSessionId, newActiveScreenId);
setTimeout(() => {
GlobalCommandRunner.syncShellState();
}, 100);
}
} else {
console.warn("unknown update", genUpdate);

View File

@ -493,7 +493,7 @@ func getEvalDepth(ctx context.Context) int {
func SyncCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) {
ids, err := resolveUiIds(ctx, pk, R_Session|R_Screen|R_RemoteConnected)
if err != nil {
return nil, fmt.Errorf("/run error: %w", err)
return nil, fmt.Errorf("/sync error: %w", err)
}
runPacket := packet.MakeRunPacket()
runPacket.ReqId = uuid.New().String()