Skip to content

Commit

Permalink
fix(terminal): fixed out-of-sync search on multiline write
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Mar 8, 2024
1 parent c617964 commit 490a437
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/dev_notes.md
Expand Up @@ -12,6 +12,7 @@
- [x] merge prs (7 merged, 4 closed)
- [x] follow up recipe maintainers regarding fxmanifest description
- [x] live console bookmarks
- [x] fix(terminal): fixed out-of-sync search on multiline write

- assorted changes
- [x] add snapshot and gc to advanced actions
Expand All @@ -27,7 +28,6 @@ seems like it just refreshes the page
- [ ] easter egg with some old music? https://www.youtube.com/watch?v=nNoaXej0Jeg
- [ ] update docs on development?

- [ ] FIXME: I am scrolled up, and each time a new row appears in live console, the highlighted part moves down a row to some random 3 characters.

- [ ] Use q5/q95 from QuantileArrayOutput to help me define the buckets, then implement the join check time histogram

Expand Down Expand Up @@ -566,7 +566,9 @@ FIXME: quando o menu abrir, deveria voltar os list item pro default deles
- apparently this can be done in scheduler quite easily by modifying the definition of `TriggerClientEvent`
- http requests (grouped by resource, grouped by root domain or both?)
- performance chart with ram usage
- player count (loger window, maybe with some other data)
- player count (longer window, maybe with some other data)
- histogram of session time
- new players per day
- top players?
- map heatmap?!
- player disconnect reasons
Expand Down
12 changes: 10 additions & 2 deletions panel/src/pages/LiveConsole/LiveConsole.tsx
Expand Up @@ -156,7 +156,7 @@ export default function LiveConsole() {

useEventListener('keydown', (e: KeyboardEvent) => {
if (e.code === 'F5') {
if(isConnected){
if (isConnected) {
refreshPage();
e.preventDefault();
}
Expand All @@ -176,6 +176,14 @@ export default function LiveConsole() {
}
});

//NOTE: quickfix for https://github.com/xtermjs/xterm.js/issues/4994
const writeToTerminal = (data: string) => {
const lines = data.split(/\r?\n/);
for (const line of lines) {
term.writeln(line);
}
}

//DEBUG
// useEffect(() => {
// let cnt = 0;
Expand Down Expand Up @@ -222,7 +230,7 @@ export default function LiveConsole() {
console.log('Live Console Socket.IO', error);
});
pageSocket.current.on('consoleData', function (data) {
term.write(data);
writeToTerminal(data);
});

return () => {
Expand Down

0 comments on commit 490a437

Please sign in to comment.