history
{" "}
- [containing '']
+ [containing '{opts.queryStr}']
{" "}
[this session ⌘S]
{" "}
@@ -680,7 +689,7 @@ class HistoryInfo extends React.Component<{}, {}> {
{" "}
[this remote ⌘R]
{" "}
- [including metacmds ⌘M]
+ [{opts.includeMeta ? "including" : "excluding"} metacmds ⌘M]
{" "} (close ESC)
diff --git a/src/model.ts b/src/model.ts
index 7f19d75e4..b4d21e111 100644
--- a/src/model.ts
+++ b/src/model.ts
@@ -633,6 +633,37 @@ class InputModel {
return false;
}
+ setHistoryQueryOpts(opts : HistoryQueryOpts) : void {
+ mobx.action(() => {
+ let oldItem = this.getHistorySelectedItem();
+ this.historyQueryOpts.set(opts);
+ if (oldItem == null) {
+ setTimeout(() => this.setHistoryIndex(0, true), 10);
+ return;
+ }
+ let newItems = this.getFilteredHistoryItems();
+ if (newItems.length == 0) {
+ setTimeout(() => this.setHistoryIndex(0, true), 10);
+ return;
+ }
+ let bestIdx = 0;
+ for (let i=0; i this.setHistoryIndex(bestIdx+1, true), 10);
+ return;
+ })();
+ }
+
setHistoryShow(show : boolean) : void {
if (this.historyShow.get() == show) {
return;
@@ -746,7 +777,54 @@ class InputModel {
getFilteredHistoryItems() : HistoryItem[] {
let hitems : HistoryItem[] = this.historyItems.get() ?? [];
- return hitems;
+ let rtn : HistoryItem[] = [];
+ let opts = mobx.toJS(this.historyQueryOpts.get());
+ let ctx = GlobalModel.getUIContext();
+ let curRemote = ctx.remote;
+ if (curRemote == null) {
+ curRemote : RemotePtrType = {ownerid: "", name: "", remoteid: ""};
+ }
+ for (let i=0; i {
diff --git a/src/sh2.less b/src/sh2.less
index 90fcdb6fe..0cf3b2aab 100644
--- a/src/sh2.less
+++ b/src/sh2.less
@@ -667,6 +667,10 @@ body .xterm .xterm-viewport {
margin-left: 58px;
}
+ .history-item.history-haderror {
+ color: mix(@term-red, @term-white, 50%);
+ }
+
.history-line:first-child {
margin-left: 0;
}
@@ -685,6 +689,10 @@ body .xterm .xterm-viewport {
color: @term-bright-white;
background-color: #444;
}
+
+ .history-item.is-selected.history-haderror {
+ color: mix(@term-bright-red, @term-bright-white, 50%);
+ }
}
}