Update: Change the prelude colors

This commit is contained in:
Derek1256 2025-03-05 22:43:52 +00:00
parent 24eaf0d619
commit 0e95f4eb57

View file

@ -53,7 +53,7 @@ const terminalProps: ITerminalOptions = {
};
export default () => {
const TERMINAL_PRELUDE = `\u001b[1m\u001b[33m${NookConfig.TERMINAL_PRELUDE} \u001b[0m`;
const TERMINAL_PRELUDE = `\u001b[1m\u001b[38;2;153;0;255m${NookConfig.TERMINAL_PRELUDE} \u001b[0m`;
const ref = useRef<HTMLDivElement>(null);
const terminal = useMemo(() => new Terminal({ ...terminalProps }), []);
const fitAddon = new FitAddon();
@ -85,10 +85,12 @@ export default () => {
}
};
const handleDaemonErrorOutput = (line: string) =>
terminal.writeln(
TERMINAL_PRELUDE + '\u001b[1m\u001b[41m' + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m'
);
const handleDaemonErrorOutput = (line: string) =>
terminal.writeln(
'\u001b[1m\u001b[38;2;153;0;255m' + NookConfig.TERMINAL_PRELUDE + '\u001b[0m' +
'\u001b[41m' + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m'
);
const handlePowerChangeEvent = (state: string) =>
terminal.writeln(TERMINAL_PRELUDE + 'Server marked as ' + state + '...\u001b[0m');
@ -114,7 +116,7 @@ export default () => {
const command = e.currentTarget.value;
if (e.key === 'Enter' && command.length > 0) {
setHistory((prevHistory) => [command, ...prevHistory!].slice(0, 32));
setHistory((prevHistory) => [command, ...prevHistory!].slice(0, 128));
setHistoryIndex(-1);
instance && instance.send('send command', command);