diff --git a/buildres/osx-sign.js b/buildres/osx-sign.js index a7e0347c0..3d29277e8 100644 --- a/buildres/osx-sign.js +++ b/buildres/osx-sign.js @@ -7,10 +7,10 @@ signAsync({ app: "temp/Wave.app", binaries: [ waveAppPath + "/Contents/Resources/app/bin/wavesrv", - waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-linux.amd64", - waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-linux.arm64", - waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-darwin.amd64", - waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-darwin.arm64", + waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-linux.amd64", + waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-linux.arm64", + waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.amd64", + waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.arm64", ], }).then(() => { console.log("signing success"); diff --git a/scripthaus.md b/scripthaus.md index 2296c243b..f3020142b 100644 --- a/scripthaus.md +++ b/scripthaus.md @@ -44,10 +44,10 @@ rm -rf bin/ rm -rf build/ node_modules/.bin/webpack --env prod GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" -(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go) (cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o ../bin/wavesrv ./cmd) node_modules/.bin/electron-forge make ``` @@ -60,10 +60,10 @@ rm -rf bin/ rm -rf build/ node_modules/.bin/webpack --env prod GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" -(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go) -(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go) +(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go) # adds -extldflags=-static, *only* on linux (macos does not support fully static binaries) to avoid a glibc dependency (cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-linkmode 'external' -extldflags=-static $GO_LDFLAGS" -o ../bin/wavesrv ./cmd) node_modules/.bin/electron-forge make @@ -86,10 +86,10 @@ CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflag set -e cd waveshell GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go -CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go -CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go -CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go +CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go +CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go +CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go ``` ```bash diff --git a/src/app/common/modals/createremoteconn.tsx b/src/app/common/modals/createremoteconn.tsx index 78ddd4985..90e197d5d 100644 --- a/src/app/common/modals/createremoteconn.tsx +++ b/src/app/common/modals/createremoteconn.tsx @@ -25,6 +25,7 @@ class CreateRemoteConnModal extends React.Component<{}, {}> { tempConnectMode: OV; tempPassword: OV; tempKeyFile: OV; + tempShellPref: OV; errorStr: OV; remoteEdit: T.RemoteEditType; model: RemotesModel; @@ -40,6 +41,7 @@ class CreateRemoteConnModal extends React.Component<{}, {}> { this.tempConnectMode = mobx.observable.box("auto", { name: "CreateRemote-connectMode" }); this.tempKeyFile = mobx.observable.box("", { name: "CreateRemote-keystr" }); this.tempPassword = mobx.observable.box("", { name: "CreateRemote-password" }); + this.tempShellPref = mobx.observable.box("detect", { name: "CreateRemote-shellPref" }); this.errorStr = mobx.observable.box(this.remoteEdit?.errorstr ?? null, { name: "CreateRemote-errorStr" }); } @@ -121,6 +123,7 @@ class CreateRemoteConnModal extends React.Component<{}, {}> { kwargs["password"] = ""; } kwargs["connectmode"] = this.tempConnectMode.get(); + kwargs["shellpref"] = this.tempShellPref.get(); kwargs["visual"] = "1"; kwargs["submit"] = "1"; let prtn = GlobalCommandRunner.createRemote(cname, kwargs, false); @@ -174,6 +177,13 @@ class CreateRemoteConnModal extends React.Component<{}, {}> { })(); } + @boundMethod + handleChangeShellPref(value: string): void { + mobx.action(() => { + this.tempShellPref.set(value); + })(); + } + @boundMethod handleChangePort(value: string): void { mobx.action(() => { @@ -357,6 +367,20 @@ class CreateRemoteConnModal extends React.Component<{}, {}> { }} /> +
+ { + this.tempShellPref.set(val); + }} + /> +
Error: {this.getErrorStr()}
diff --git a/src/app/common/modals/editremoteconn.tsx b/src/app/common/modals/editremoteconn.tsx index f08efc807..6502aa191 100644 --- a/src/app/common/modals/editremoteconn.tsx +++ b/src/app/common/modals/editremoteconn.tsx @@ -24,6 +24,7 @@ class EditRemoteConnModal extends React.Component<{}, {}> { tempPassword: OV; tempConnectMode: OV; tempAuthMode: OV; + tempShellPref: OV; model: RemotesModel; constructor(props: { remotesModel?: RemotesModel }) { @@ -34,6 +35,7 @@ class EditRemoteConnModal extends React.Component<{}, {}> { this.tempKeyFile = mobx.observable.box(null, { name: "EditRemoteSettings-tempKeyFile" }); this.tempPassword = mobx.observable.box(null, { name: "EditRemoteSettings-tempPassword" }); this.tempConnectMode = mobx.observable.box(null, { name: "EditRemoteSettings-tempConnectMode" }); + this.tempShellPref = mobx.observable.box(null, { name: "EditRemoteSettings-tempShellPref" }); } get selectedRemoteId() { @@ -52,6 +54,10 @@ class EditRemoteConnModal extends React.Component<{}, {}> { return this.model.isAuthEditMode(); } + isLocalRemote(): boolean { + return this.selectedRemote?.local; + } + componentDidMount(): void { mobx.action(() => { this.tempAlias.set(this.selectedRemote?.remotealias); @@ -59,6 +65,7 @@ class EditRemoteConnModal extends React.Component<{}, {}> { this.tempPassword.set(this.remoteEdit?.haspassword ? PasswordUnchangedSentinel : ""); this.tempConnectMode.set(this.selectedRemote?.connectmode); this.tempAuthMode.set(this.selectedRemote?.authtype); + this.tempShellPref.set(this.selectedRemote?.shellpref); })(); } @@ -103,6 +110,13 @@ class EditRemoteConnModal extends React.Component<{}, {}> { })(); } + @boundMethod + handleChangeShellPref(value: string): void { + mobx.action(() => { + this.tempShellPref.set(value); + })(); + } + @boundMethod canResetPw(): boolean { if (this.remoteEdit == null) { @@ -154,6 +168,9 @@ class EditRemoteConnModal extends React.Component<{}, {}> { if (!util.isStrEq(this.tempConnectMode.get(), this.selectedRemote?.connectmode)) { kwargs["connectmode"] = this.tempConnectMode.get(); } + if (!util.isStrEq(this.tempShellPref.get(), this.selectedRemote?.shellpref)) { + kwargs["shellpref"] = this.tempShellPref.get(); + } kwargs["visual"] = "1"; kwargs["submit"] = "1"; GlobalCommandRunner.editRemote(this.selectedRemote?.remoteid, kwargs); @@ -183,11 +200,150 @@ class EditRemoteConnModal extends React.Component<{}, {}> { return null; } - render() { + renderAlias() { + return ( +
+ + } + > + + + + ), + }} + /> +
+ ); + } + + renderConnectMode() { + return ( +
+ +
+ ); + } + + renderShellPref() { + return ( +
+ +
+ ); + } + + renderAuthMode() { let authMode = this.tempAuthMode.get(); + return ( + <> +
+ + +
  • + none - no authentication, or authentication is already + configured in your ssh config. +
  • +
  • + key - use a private key. +
  • +
  • + password - use a password. +
  • +
  • + key+password - use a key with a passphrase. +
  • + + } + icon={} + > + +
    + + ), + }} + /> +
    + + + } + > + + + + ), + }} + /> + + + + + + ); + } + + render() { if (this.remoteEdit === null || !this.isAuthEditMode) { return null; } + let isLocal = this.isLocalRemote(); return ( @@ -195,110 +351,10 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
    {util.getRemoteName(this.selectedRemote)}
    -
    - - } - > - - - - ), - }} - /> -
    -
    - - -
  • - none - no authentication, or authentication is already - configured in your ssh config. -
  • -
  • - key - use a private key. -
  • -
  • - password - use a password. -
  • -
  • - key+password - use a key with a passphrase. -
  • - - } - icon={} - > - -
    - - ), - }} - /> -
    - - - } - > - - - - ), - }} - /> - - - - -
    - -
    + {this.renderAlias()} + {this.renderAuthMode()} + {this.renderConnectMode()} + {this.renderShellPref()}
    Error: {this.remoteEdit?.errorstr}
    diff --git a/src/app/common/modals/viewremoteconndetail.tsx b/src/app/common/modals/viewremoteconndetail.tsx index c0518d07a..5fa461fb4 100644 --- a/src/app/common/modals/viewremoteconndetail.tsx +++ b/src/app/common/modals/viewremoteconndetail.tsx @@ -206,7 +206,6 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> { ); if (remote.local) { installNowButton = <>; - updateAuthButton = <>; cancelInstallButton = <>; } if (remote.sshconfigsrc == "sshconfig-import") { @@ -352,6 +351,10 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
    Connect Mode
    {remote.connectmode}
    +
    +
    Shell Pref
    +
    {remote.shellpref}
    +
    {this.renderInstallStatus(remote)}
    diff --git a/src/app/workspace/cmdinput/cmdinput.less b/src/app/workspace/cmdinput/cmdinput.less index 69efc8521..21a34236c 100644 --- a/src/app/workspace/cmdinput/cmdinput.less +++ b/src/app/workspace/cmdinput/cmdinput.less @@ -128,6 +128,22 @@ padding: 1em 2px; } + .textareainput-div { + position: relative; + + .shelltag { + position: absolute; + bottom: 4px; + right: 3px; + font-size: 10px; + color: @text-secondary; + line-height: 1; + padding: 0px 8px 3px 8px; + background-color: @textarea-background; + border-radius: 0 0 5px 5px; + } + } + textarea { color: @term-bright-white; background-color: @textarea-background; diff --git a/src/app/workspace/cmdinput/cmdinput.tsx b/src/app/workspace/cmdinput/cmdinput.tsx index a13e961d0..f6b0693bd 100644 --- a/src/app/workspace/cmdinput/cmdinput.tsx +++ b/src/app/workspace/cmdinput/cmdinput.tsx @@ -99,6 +99,11 @@ class CmdInput extends React.Component<{}, {}> { })(); } + @boundMethod + clickResetState(): void { + GlobalCommandRunner.resetShellState(); + } + render() { let model = GlobalModel; let inputModel = model.inputModel; @@ -115,6 +120,7 @@ class CmdInput extends React.Component<{}, {}> { remote = GlobalModel.getRemote(ri.remoteid); feState = ri.festate; } + feState = feState || {}; let infoShow = inputModel.infoShow.get(); let historyShow = !infoShow && inputModel.historyShow.get(); let aiChatShow = inputModel.aIChatShow.get(); @@ -162,6 +168,18 @@ class CmdInput extends React.Component<{}, {}> {
    + +
    + WARNING:  The shell state for this tab is invalid ( + + see FAQ + + ). Must reset to continue. +
    + reset shell state +
    +
    +
    diff --git a/src/app/workspace/cmdinput/textareainput.tsx b/src/app/workspace/cmdinput/textareainput.tsx index 8cca3b89d..eb1a550bd 100644 --- a/src/app/workspace/cmdinput/textareainput.tsx +++ b/src/app/workspace/cmdinput/textareainput.tsx @@ -5,6 +5,8 @@ import * as React from "react"; import * as mobxReact from "mobx-react"; import * as mobx from "mobx"; import type * as T from "../../../types/types"; +import * as util from "../../../util/util"; +import { If } from "tsx-control-statements/components"; import { boundMethod } from "autobind-decorator"; import cn from "classnames"; import { GlobalModel, GlobalCommandRunner, Screen } from "../../../model/model"; @@ -585,8 +587,24 @@ class TextAreaInput extends React.Component<{ screen: Screen; onHeightChange: () let computedInnerHeight = displayLines * (termFontSize * 1.5) + 2 * 0.5 * termFontSize; // inner height + 2*1em padding let computedOuterHeight = computedInnerHeight + 2 * 1.0 * termFontSize; + let shellType: string = ""; + let screen = GlobalModel.getActiveScreen(); + if (screen != null) { + let ri = screen.getCurRemoteInstance(); + console.log("got ri", ri); + if (ri != null && ri.shelltype != null) { + shellType = ri.shelltype; + } + } return ( -
    +
    + +
    {shellType}
    +