Debug console doesn't open
I couldn't find anything in the code about that. At the end of this https://github.com/sst/opentui/blob/main/packages/core/docs/development.md it's mentioned that I can open console using backtick, meanwhile nothing happens for me. I tried creating completely clear project, tried couple differents terminals (all windows, cmd, powershell, windows terminal). Tried defining my own shortcuts in new project to open console which also didn't help. What's strange is that I can log all keys and they are being recorded correctly.
To recreate simply create new project and try to open console with backtick.
"dependencies": {
"@opentui/core": "^0.1.63",
"@opentui/react": "^0.1.63",
"react": "^19.2.3"
}
I couldn't find anything in the code about that. At the end of this https://github.com/sst/opentui/blob/main/packages/core/docs/development.md it's mentioned that I can open console using backtick ...
this isn't a default behaviour! there's a common helper function for this in the examples (might be where the confusion comes from)
import { createCliRenderer } from "@opentui/core";
import { createRoot, useKeyboard, useRenderer } from "@opentui/react";
import { useEffect } from "react";
function App() {
const renderer = useRenderer();
useEffect(() => {
console.log("Hello, world!");
}, []);
useKeyboard((key) => {
if (key.name === "`") {
renderer.console.toggle();
}
});
return <text>Press ` to toggle the console</text>;
}
const renderer = await createCliRenderer();
createRoot(renderer).render(<App />);
import { createCliRenderer } from "@opentui/core"; import { createRoot, useKeyboard, useRenderer } from "@opentui/react"; import { useEffect } from "react";
function App() { const renderer = useRenderer();
useEffect(() => { console.log("Hello, world!"); }, []);
useKeyboard((key) => { if (key.name === "`") { renderer.console.toggle(); } });
return
Press ` to toggle the console ; }const renderer = await createCliRenderer(); createRoot(renderer).render(
);
Haven't seen it... For some reason it worked even tho I already tried to assign my own keybinds. Must have done something wrong. Thanks a lot!