diff --git a/src/main.tsx b/src/main.tsx index 249c1f321..548a23c59 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -669,27 +669,22 @@ class TextAreaInput extends React.Component<{}, {}> { } @mobxReact.observer -class InfoMsg extends React.Component<{}, {}> { - getAfterSlash(s : string) : string { - if (s.startsWith("^/")) { - return s.substr(1); +class InfoShowRemote extends React.Component<{}, {}> { + getRemoteTypeStr(remote : RemoteType) : string { + let mshellStr = ""; + if (!isBlank(remote.mshellversion)) { + mshellStr = "mshell=" + remote.mshellversion; } - let slashIdx = s.lastIndexOf("/"); - if (slashIdx == s.length-1) { - slashIdx = s.lastIndexOf("/", slashIdx-1); + if (!isBlank(remote.uname)) { + if (mshellStr != "") { + mshellStr += " "; + } + mshellStr += "uname=\"" + remote.uname + "\""; } - if (slashIdx == -1) { - return s; - } - return s.substr(slashIdx+1); - } - - @boundMethod - clickTermBlock(e : any) { - let inputModel = GlobalModel.inputModel; - if (inputModel.remoteTermWrap != null) { - inputModel.remoteTermWrap.terminal.focus(); + if (mshellStr == "") { + return remote.remotetype; } + return remote.remotetype + " (" + mshellStr + ")"; } @boundMethod @@ -711,21 +706,94 @@ class InfoMsg extends React.Component<{}, {}> { } } - getRemoteTypeStr(remote : RemoteType) : string { - let mshellStr = ""; - if (!isBlank(remote.mshellversion)) { - mshellStr = "mshell=" + remote.mshellversion; + @boundMethod + clickTermBlock(e : any) { + let inputModel = GlobalModel.inputModel; + if (inputModel.remoteTermWrap != null) { + inputModel.remoteTermWrap.terminal.focus(); } - if (!isBlank(remote.uname)) { - if (mshellStr != "") { - mshellStr += " "; - } - mshellStr += "uname=\"" + remote.uname + "\""; + } + + render() { + let inputModel = GlobalModel.inputModel; + let infoMsg = inputModel.infoMsg.get(); + let ptyRemoteId = (infoMsg == null ? null : infoMsg.ptyremoteid); + let isTermFocused = (inputModel.remoteTermWrap == null ? false : inputModel.remoteTermWrap.isFocused.get()); + let remote : RemoteType; + if (ptyRemoteId != null) { + remote = GlobalModel.getRemote(ptyRemoteId); } - if (mshellStr == "") { - return remote.remotetype; + if (ptyRemoteId == null || remote == null) { + return ( + <> +