diff --git a/.changeset/nasty-papayas-happen.md b/.changeset/nasty-papayas-happen.md new file mode 100644 index 000000000000..9547dd5bde9c --- /dev/null +++ b/.changeset/nasty-papayas-happen.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +feat: add hotkey to clear the console in `wrangler dev` + +Closes #388 diff --git a/packages/wrangler/src/dev/dev.tsx b/packages/wrangler/src/dev/dev.tsx index d199f64292e0..ec565ea36078 100644 --- a/packages/wrangler/src/dev/dev.tsx +++ b/packages/wrangler/src/dev/dev.tsx @@ -139,7 +139,7 @@ function InteractiveDevSession(props: InteractiveDevSessionProps) { {`B to open a browser, D to open Devtools, L to ${ toggles.local ? "turn off" : "turn on" - } local mode, X to exit`} + } local mode, C to clear console, X to exit`} @@ -350,6 +350,13 @@ function useHotkeys( key ) => { switch (input.toLowerCase()) { + // clear console + case "c": + console.clear(); + // This console.log causes Ink to re-render the `DevSession` component. + // Couldn't find a better way to tell it to do so... + console.log(); + break; // open browser case "b": { await openInBrowser(`${localProtocol}://${ip}:${port}`);