Fix #3240: make command history work

This commit is contained in:
Oliver Blanthorn 2021-01-21 18:33:59 +01:00
parent 673d4ee380
commit 7f8b0ff925
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -199,7 +199,7 @@ commandline_state.clInput.addEventListener(
if (response.value.startsWith("ex.")) {
const [funcname, ...args] = response.value.slice(3).split(/\s+/)
QUEUE[QUEUE.length - 1].then(() =>
QUEUE[QUEUE.length - 1].then(() => {
QUEUE.push(
// Abuse async to wrap non-promises in a promise
// eslint-disable-next-line @typescript-eslint/require-await
@ -207,10 +207,9 @@ commandline_state.clInput.addEventListener(
commandline_state.fns[funcname](
args.length === 0 ? undefined : args.join(" "),
))(),
),
)
prev_cmd_called_history = history_called
})
} else {
// Send excmds directly to our own tab, which fixes the
// old bug where a command would be issued in one tab but