diff --git a/src/model.ts b/src/model.ts
index 79816a5f..d35a4d48 100644
--- a/src/model.ts
+++ b/src/model.ts
@@ -176,7 +176,7 @@ class Cmd {
}
handleData(data : string, termWrap : TermWrap) : void {
- console.log("handle data", {data: data});
+ // console.log("handle data", {data: data});
if (!this.isRunning()) {
return;
}
@@ -848,6 +848,7 @@ class InputModel {
remoteTermWrapFocus : OV = mobx.observable.box(false, {name: "remoteTermWrapFocus"});
showNoInputMsg : OV = mobx.observable.box(false);
showNoInputTimeoutId : any = null;
+ inputMode : OV = mobx.observable.box(null);
// focus
inputFocused : OV = mobx.observable.box(false);
@@ -866,6 +867,12 @@ class InputModel {
})();
}
+ setInputMode(inputMode : null | "comment" | "global") : void {
+ mobx.action(() => {
+ this.inputMode.set(inputMode);
+ })();
+ }
+
setShowNoInputMsg(val : boolean) {
mobx.action(() => {
if (this.showNoInputTimeoutId != null) {
@@ -1365,9 +1372,24 @@ class InputModel {
})();
}
+ resetInputMode() : void {
+ mobx.action(() => {
+ inputModel.setInputMode(null);
+ inputModel.setCurLine("");
+ })();
+ }
+
setCurLine(val : string) : void {
let hidx = this.historyIndex.get();
mobx.action(() => {
+ if (val == "\" ") {
+ this.setInputMode("comment");
+ val = "";
+ }
+ if (val == "//") {
+ this.setInputMode("global");
+ val = "";
+ }
if (this.modHistory.length <= hidx) {
this.modHistory.length = hidx + 1;
}
@@ -1379,6 +1401,7 @@ class InputModel {
mobx.action(() => {
this.setHistoryShow(false);
this.infoShow.set(false);
+ this.inputMode.set(null);
this.resetHistory();
this.dropModHistory(false);
this.infoMsg.set(null);
@@ -2165,7 +2188,7 @@ class CommandRunner {
}
resizeWindow(windowId : string, cols : number) {
- GlobalModel.submitCommand("window", "resize", null, {"nohist": "1", "window": windowId, "cols": String(cols)}, false);
+ GlobalModel.submitCommand("sw", "resize", null, {"nohist": "1", "window": windowId, "cols": String(cols)}, false);
}
showRemote(remoteid : string) {
diff --git a/src/sh2.less b/src/sh2.less
index 8aa4d793..c775691b 100644
--- a/src/sh2.less
+++ b/src/sh2.less
@@ -787,6 +787,16 @@ body .xterm .xterm-viewport {
color: white;
}
+ &.inputmode-global .cmd-quick-context .button {
+ color: black;
+ background-color: @tab-green !important;
+ }
+
+ &.inputmode-comment .cmd-quick-context .button {
+ color: black;
+ background-color: @tab-blue !important;
+ }
+
.cmd-exec .button {
background-color: #000 !important;
color: #d3d7cf;