console.log, console.info, console.warn, console.error, console.debug) and displays it in a visual overlay without disrupting your main interface.
Quick Start
The console is automatically available in every OpenTUI application. Press` (backtick) to toggle it.
Configuration
Customize the console when creating the renderer:Console Positions
The console can be positioned at any edge:- Bottom (Default)
- Top
- Left
- Right
Keyboard Controls
When the console is focused, you can navigate and control it:| Key | Action |
|---|---|
` | Toggle console (show/hide/focus) |
↑ / ↓ | Scroll up/down one line |
Shift+↑ | Jump to top |
Shift+↓ | Jump to bottom |
Ctrl+P | Move to previous position (top → right → bottom → left) |
Ctrl+O | Move to next position |
+ or Shift+= | Increase console size |
- | Decrease console size |
Ctrl+S | Save logs to file |
Ctrl+Shift+C | Copy selected text (if selection exists) |
Escape | Unfocus console (keep visible) |
Programmatic Control
Show, Hide, and Toggle
Clear Console
Log Levels and Colors
Different log levels are automatically color-coded:Debug Mode
Enable debug mode to show caller information (file name, line number) with each log:Text Selection and Copy
Select text in the console with mouse drag or keyboard, then copy it:Mouse Selection
- Click and drag to select text
- Click the
[Copy]button or pressCtrl+Shift+C
Custom Copy Handler
Handle the copy action yourself (e.g., to copy to system clipboard):Custom Key Bindings
Customize the copy shortcut:Saving Logs
Save console output to a file:Environment Variables
Control console behavior via environment variables:Advanced: Custom Key Bindings
Completely customize console keyboard controls:scroll-up- Scroll up one linescroll-down- Scroll down one linescroll-to-top- Jump to topscroll-to-bottom- Jump to bottomposition-previous- Move to previous edgeposition-next- Move to next edgesize-increase- Make console largersize-decrease- Make console smallersave-logs- Save logs to filecopy-selection- Copy selected text
Complete Example
Performance Tips
Limit Log Retention
Limit Log Retention
Set reasonable limits for stored logs:
Disable When Not Needed
Disable When Not Needed
Disable console capture in production:
Use Debug Mode Sparingly
Use Debug Mode Sparingly
Debug mode collects stack traces which adds overhead:
Common Issues
Console Not Showing
Console Not Showing
Check if console is enabled:
Logs Not Appearing
Logs Not Appearing
Ensure you’re using console methods after renderer is created:
Can't Copy Text
Can't Copy Text
Provide a copy handler:
Next Steps
Animations
Add smooth animations to your app
3D Rendering
Render 3D graphics with WebGPU