diff --git a/src/session.ts b/src/session.ts index 86e504b5..94dc18f3 100644 --- a/src/session.ts +++ b/src/session.ts @@ -33,15 +33,21 @@ type RemoteType = { remoteid : string, remotename : string, status : string, + defaultstate : RemoteStateType, +}; + +type RemoteStateType = { cwd : string, }; -type SessionRemoteDataType = { +type RemoteInstanceType = { + riid : string, + name : string, sessionid : string, windowid : string, remoteid : string, - remotename : string, - cwd : string, + sessionscope : boolean, + state : RemoteStateType, } type WindowDataType = { @@ -77,30 +83,37 @@ class Session { termMapById : Record = {}; history : HistoryItem[] = []; loading : mobx.IObservableValue = mobx.observable.box(false); - remotes : SessionRemoteDataType[] = []; + remotes : RemoteInstanceType[] = []; globalRemotes : RemoteType[]; constructor() { } - getWindowCurRemoteData(windowid : string) : SessionRemoteDataType { - let window = this.getWindowById(windowid); - if (window == null) { + getWindowCurRemoteData(windowid : string) : RemoteInstanceType { + let win = this.getWindowById(windowid); + if (win == null) { return null; } + let rname = win.curremote; + let sessionScope = false; + if (rname.startsWith("^")) { + rname = rname.substr(1); + sessionScope = true; + } for (let i=0; i