mirror of
https://github.com/luc-github/ESP3D-WEBUI.git
synced 2026-02-20 01:11:21 +01:00
Fix Up/Down key erratic behavior in terminal
This commit is contained in:
BIN
dist/CNC/GRBL/index.html.gz
vendored
BIN
dist/CNC/GRBL/index.html.gz
vendored
Binary file not shown.
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
Binary file not shown.
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
Binary file not shown.
BIN
dist/SandTable/GRBL/index.html.gz
vendored
BIN
dist/SandTable/GRBL/index.html.gz
vendored
Binary file not shown.
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
import { h } from "preact"
|
||||
import { webUIbuild } from "../../targets"
|
||||
export const webUIversion = "3.0.0-a69"
|
||||
export const webUIversion = "3.0.0-a70"
|
||||
export const Esp3dVersion = () => (
|
||||
<span>
|
||||
{webUIversion}.{webUIbuild}
|
||||
|
||||
@@ -59,7 +59,7 @@ const TerminalPanel = () => {
|
||||
const messagesEndRef = useRef(null)
|
||||
const terminalOutput = useRef(null)
|
||||
const id = "terminalPanel"
|
||||
const inputHistoryIndex = useRef(terminal.inputHistory.length - 1)
|
||||
const inputHistoryIndex = useRef(terminal.inputHistory.length )
|
||||
const scrollToBottom = () => {
|
||||
if (
|
||||
terminal.isAutoScroll.current &&
|
||||
@@ -70,17 +70,17 @@ const TerminalPanel = () => {
|
||||
}
|
||||
}
|
||||
const historyPrev = () => {
|
||||
if (terminal.inputHistory.length > 0 && inputHistoryIndex.current >= 0) {
|
||||
if (terminal.inputHistory.length > 0 && inputHistoryIndex.current > 0) {
|
||||
inputHistoryIndex.current--
|
||||
inputRef.current.value = terminal.inputHistory[inputHistoryIndex.current]
|
||||
terminal.input.current = inputRef.current.value
|
||||
inputHistoryIndex.current--
|
||||
}
|
||||
}
|
||||
|
||||
const historyNext = () => {
|
||||
if (
|
||||
terminal.inputHistory.length > 0 &&
|
||||
inputHistoryIndex.current < terminal.inputHistory.length - 1
|
||||
inputHistoryIndex.current < terminal.inputHistory.length-1
|
||||
) {
|
||||
inputHistoryIndex.current++
|
||||
inputRef.current.value = terminal.inputHistory[inputHistoryIndex.current]
|
||||
@@ -88,7 +88,8 @@ const TerminalPanel = () => {
|
||||
} else {
|
||||
inputRef.current.value = ""
|
||||
terminal.input.current = inputRef.current.value
|
||||
}
|
||||
inputHistoryIndex.current = terminal.inputHistory.length
|
||||
}
|
||||
}
|
||||
const onKeyUp = (e) => {
|
||||
switch (e.keyCode) {
|
||||
@@ -122,7 +123,7 @@ const TerminalPanel = () => {
|
||||
) {
|
||||
terminal.addInputHistory(cmd)
|
||||
}
|
||||
inputHistoryIndex.current = terminal.inputHistory.length - 1
|
||||
inputHistoryIndex.current = terminal.inputHistory.length
|
||||
processData(
|
||||
"echo",
|
||||
replaceVariables(variablesList.commands, cmd, true)
|
||||
@@ -142,9 +143,8 @@ const TerminalPanel = () => {
|
||||
},
|
||||
}
|
||||
)
|
||||
} else {
|
||||
inputHistoryIndex.current = terminal.inputHistory.length - 1
|
||||
}
|
||||
}
|
||||
inputHistoryIndex.current = terminal.inputHistory.length
|
||||
terminal.input.current = ""
|
||||
inputRef.current.value = ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user