From 8e4c9172c0eb4d0f0f78608394f3b67f0fcc5377 Mon Sep 17 00:00:00 2001 From: sawka Date: Mon, 13 Mar 2023 21:56:29 -0700 Subject: [PATCH] add some hints --- src/main.tsx | 33 ++++++++++++++++++++++----------- src/sh2.less | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 7e6fbf58..59d33f6e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -320,13 +320,6 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> { inputModel.resetInput(); return; } - if (e.code == "KeyM" && (e.getModifierState("Meta") || e.getModifierState("Control"))) { - e.preventDefault(); - let opts = mobx.toJS(inputModel.historyQueryOpts.get()); - opts.includeMeta = !opts.includeMeta; - inputModel.setHistoryQueryOpts(opts); - return; - } if (e.code == "KeyR" && ((e.getModifierState("Meta") || e.getModifierState("Control")) && !e.getModifierState("Shift"))) { e.preventDefault(); let opts = mobx.toJS(inputModel.historyQueryOpts.get()); @@ -1387,8 +1380,6 @@ class HistoryInfo extends React.Component<{}, {}> {
[containing '{opts.queryStr}']
[{opts.limitRemote ? "this" : "any"} remote ⌘R]
-
-
[{opts.includeMeta ? "" : "no "}metacmds ⌘M]
(ESC)
@@ -1444,6 +1435,22 @@ class CmdInput extends React.Component<{}, {}> { handleInnerHeightUpdate() : void { this.updateCmdInputHeight(); } + + @boundMethod + clickFocusInputHint() : void { + GlobalModel.inputModel.giveFocus(); + } + + @boundMethod + clickHistoryHint() : void { + let inputModel = GlobalModel.inputModel; + if (inputModel.historyShow.get()) { + inputModel.resetHistory(); + } + else { + inputModel.openHistory(); + } + } render() { let model = GlobalModel; @@ -1497,12 +1504,16 @@ class CmdInput extends React.Component<{}, {}> {
-
+
+
+
focus input (⌘I)
+
{historyShow ? "close history (esc)" : "show history (ctrl-r)"}
+
); @@ -2171,7 +2182,7 @@ class ScreenTabs extends React.Component<{session : Session}, {}> {
- + +
⌘T
); diff --git a/src/sh2.less b/src/sh2.less index 6028f4d2..849ccce4 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -885,8 +885,8 @@ body::-webkit-scrollbar { } .screen-tab.new-screen { - width: 30px; - min-width: 30px; + width: 80px; + min-width: 80px; background-color: black; border-right: none; color: #ccc; @@ -1786,10 +1786,53 @@ body .xterm .xterm-viewport { } .cmd-input-field { + position: relative; + .cmd-input-control { line-height: 0; } - + + .cmd-input-hints { + position: absolute; + bottom: -14px; + right: 0px; + .mono-font(10px); + display: flex; + flex-direction: row; + + .hint-item { + padding: 0px 5px 0px 5px; + border-radius: 0 0 3px 3px; + cursor: pointer; + + &:hover { + font-weight: bold; + } + } + + .hint-item:not(:last-child) { + margin-right: 8px; + } + + .hint-item.color-green { + color: black; + background-color: @tab-green; + + &:hover { + color: white; + } + } + + .hint-item.color-white { + color: black; + background-color: @term-white; + + &:hover { + background-color: @term-bright-white; + } + } + } + textarea { color: white; background-color: black;