diff --git a/src/main.tsx b/src/main.tsx index 4e61d8e9e..4d4d54236 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -9,7 +9,7 @@ import dayjs from "dayjs"; import {If, For, When, Otherwise, Choose} from "tsx-control-statements/components"; import cn from "classnames"; import {TermWrap} from "./term"; -import type {SessionDataType, LineType, CmdDataType, RemoteType, RemoteStateType, RemoteInstanceType, RemotePtrType, HistoryItem, HistoryQueryOpts, RemoteEditType} from "./types"; +import type {SessionDataType, LineType, CmdDataType, RemoteType, RemoteStateType, RemoteInstanceType, RemotePtrType, HistoryItem, HistoryQueryOpts, RemoteEditType, FeStateType} from "./types"; import localizedFormat from 'dayjs/plugin/localizedFormat'; import {GlobalModel, GlobalCommandRunner, Session, Cmd, Window, Screen, ScreenWindow, riToRPtr, widthToCols, termWidthFromCols, termHeightFromRows, termRowsFromHeight} from "./model"; import {isModKeyPress} from "./util"; @@ -103,7 +103,7 @@ function replaceHomePath(path : string, homeDir : string) : string { return path; } -function getCwdStr(remote : RemoteType, state : RemoteStateType) : string { +function getCwdStr(remote : RemoteType, state : FeStateType) : string { if ((state == null || state.cwd == null) && remote != null) { return "~"; } @@ -112,7 +112,7 @@ function getCwdStr(remote : RemoteType, state : RemoteStateType) : string { cwd = state.cwd; } if (remote && remote.remotevars.home) { - cwd = replaceHomePath(cwd, remote.remotevars.home) + cwd = replaceHomePath(cwd, remote.remotevars.cwd) } return cwd; } @@ -185,14 +185,14 @@ class LineText extends React.Component<{sw : ScreenWindow, line : LineType}, {}> } @mobxReact.observer -class Prompt extends React.Component<{rptr : RemotePtrType, rstate : RemoteStateType}, {}> { +class Prompt extends React.Component<{rptr : RemotePtrType, festate : FeStateType}, {}> { render() { let remote : RemoteType = null; if (this.props.rptr && !isBlank(this.props.rptr.remoteid)) { remote = GlobalModel.getRemote(this.props.rptr.remoteid); } let remoteStr = getRemoteStr(this.props.rptr); - let cwd = getCwdStr(remote, this.props.rstate); + let cwd = getCwdStr(remote, this.props.festate); let isRoot = false; if (remote && remote.remotevars) { if (remote.remotevars["sudo"] || remote.remotevars["bestuser"] == "root") { @@ -344,10 +344,10 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width ); } let remoteStr = getRemoteStr(cmd.remote); - let cwd = getCwdStr(remote, cmd.getRemoteState()); + let cwd = getCwdStr(remote, cmd.getRemoteFeState()); return (
- {cmd.getSingleLineCmdText()} + {cmd.getSingleLineCmdText()}
); } @@ -1730,10 +1730,10 @@ class CmdInput extends React.Component<{}, {}> { rptr = win.curRemote.get(); } let remote : RemoteType = null; - let remoteState : RemoteStateType = null; + let remoteState : FeStateType = null; if (ri != null) { remote = GlobalModel.getRemote(ri.remoteid); - remoteState = ri.state; + remoteState = ri.festate; } let remoteStr = getRemoteStr(rptr); let cwdStr = getCwdStr(remote, remoteState); @@ -1762,7 +1762,7 @@ class CmdInput extends React.Component<{}, {}> {
- +
@@ -2475,7 +2475,7 @@ class MainSideBar extends React.Component<{}, {}> {

- this.clickRemotes()}>Remotes + this.clickRemotes()}>Connections

@@ -2551,7 +2551,7 @@ class DisconnectedModal extends React.Component<{}, {}> {
-

ScriptHaus Client Disconnected

+

Prompt Client Disconnected

@@ -2600,7 +2600,7 @@ class Main extends React.Component<{}, {}> { render() { return (
-

+

prompt>

diff --git a/src/model.ts b/src/model.ts index efd6d882c..3203ab4e1 100644 --- a/src/model.ts +++ b/src/model.ts @@ -5,7 +5,7 @@ import {debounce} from "throttle-debounce"; import {handleJsonFetchResponse, base64ToArray, genMergeData, genMergeSimpleData, boundInt, isModKeyPress} from "./util"; import {TermWrap} from "./term"; import {v4 as uuidv4} from "uuid"; -import type {SessionDataType, WindowDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenWindowType, ScreenOptsType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize, RemoteInputPacketType} from "./types"; +import type {SessionDataType, WindowDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenWindowType, ScreenOptsType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize, RemoteInputPacketType, FeStateType} from "./types"; import {WSControl} from "./ws"; var GlobalUser = "sawka"; @@ -165,8 +165,8 @@ class Cmd { return this.data.get().cmdstr; } - getRemoteState() : RemoteStateType { - return this.data.get().remotestate; + getRemoteFeState() : FeStateType { + return this.data.get().festate; } getSingleLineCmdText() { @@ -820,8 +820,7 @@ class Session { let remote = GlobalModel.getRemote(rptr.remoteid); if (remote != null) { return {riid: "", sessionid: this.sessionId, windowid: windowId, - remoteownerid: rptr.ownerid, remoteid: rptr.remoteid, name: rptr.name, - state: remote.defaultstate}; + remoteownerid: rptr.ownerid, remoteid: rptr.remoteid, name: rptr.name, festate: remote.defaultfestate}; } return null; } @@ -1611,8 +1610,8 @@ class Model { screenid : null, windowid : null, remote : null, - termopts : {}, winsize: null, + linenum: null, }; let session = this.getActiveSession(); if (session != null) { @@ -1627,8 +1626,8 @@ class Model { } let sw = screen.getActiveSW(); if (sw != null) { - rtn.termopts.cols = sw.lastCols; rtn.winsize = {rows: sw.lastRows, cols: sw.lastCols}; + rtn.linenum = sw.selectedLine.get(); } } } diff --git a/src/sh2.less b/src/sh2.less index 358302912..1ea2956c6 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -163,7 +163,7 @@ html, body, #main { } } -.title.scripthaus-logo-small { +.title.prompt-logo-small { padding-left: 10px; padding-top: 8px; padding-bottom: 8px; diff --git a/src/types.ts b/src/types.ts index aec5bd192..d3af31cd7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -87,7 +87,7 @@ type RemoteType = { errorstr : string, installstatus : string, installerrorstr : string, - defaultstate : RemoteStateType, + defaultfestate : FeStateType, connectmode : string, autoinstall : boolean, remoteidx : number, @@ -112,11 +112,15 @@ type RemoteInstanceType = { windowid : string, remoteownerid : string, remoteid : string, - state : RemoteStateType, + festate : FeStateType, remove? : boolean, } +type FeStateType = { + cwd : string, +}; + type RemotePtrType = { ownerid : string, remoteid : string, @@ -158,20 +162,13 @@ type CmdRemoteStateType = { cwd : string, }; -type UIContextTermOptsType = { - rows? : number, - cols? : number, - term? : string, - maxptysize? : number, -}; - type UIContextType = { sessionid : string, screenid : string, windowid : string, remote : RemotePtrType, - termopts : UIContextTermOptsType, winsize : TermWinSize, + linenum : number, }; type FeCmdPacketType = { @@ -228,10 +225,8 @@ type CmdStartPacketType = { mshellpid : number, }; -type CmdDonePacketType = { - type : string, +type CmdDoneInfoType = { ts : number, - ck : string, exitcode : number, durationms : number, }; @@ -241,12 +236,12 @@ type CmdDataType = { cmdid : string, remote : RemotePtrType, cmdstr : string, - remotestate : RemoteStateType, + festate : FeStateType, termopts : TermOptsType, origtermopts : TermOptsType, status : string, startpk : CmdStartPacketType, - donepk : CmdDonePacketType, + doneinfo : CmdDoneInfoType, runout : any[], rtnstate : boolean, remove? : boolean, @@ -324,4 +319,4 @@ type HistoryQueryOpts = { type UpdateMessage = PtyDataUpdateType | ModelUpdateType; -export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, WindowDataType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDonePacketType, CmdDataType, ScreenDataType, ScreenOptsType, ScreenWindowType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType, RemoteInputPacketType, RemoteEditType}; +export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, WindowDataType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDataType, ScreenDataType, ScreenOptsType, ScreenWindowType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType, RemoteInputPacketType, RemoteEditType, FeStateType};