Problem statement
Feature Description
Add a "Clear Terminal" button to the terminal panel that clears all terminal output with one click.
Current Problem
Currently, terminal output accumulates over time. Users have to manually type the clear command or refresh the page, which is not convenient, especially on mobile devices.
Proposed Solution
Add a "Clear Terminal" button (trash can 🗑️ or broom 🧹 icon) to the terminal component's top-right corner (or existing button panel). When clicked:
- All terminal text/history is cleared
- A fresh prompt shows (like
$ or > )
- Only visible output is cleared - WebContainer terminal instance does NOT reset
Expected Behavior
- Terminal clears instantly on button click
- No undo needed (clear is a one-way action)
- Optional keyboard shortcut:
Ctrl/Cmd + L (standard terminal convention)
Alternative Approaches Considered
- User types
clear command (current workaround)
- Right-click context menu with "Clear" option (more complex)
Additional Context
- All popular IDEs (VS Code, Cursor, Windsurf) have a clear terminal button
- Very helpful for mobile users who can't easily type
clear on soft keyboard
- Simple implementation: Use xterm.js
clear() method
Mockup
Terminal header should have delete icon:
[Terminal] [🐚 bash] [🗑️ Clear] [✖️ Close]
Labels requested: gssoc26, gssoc:approved, level:intermediate
Proposed solution
Add a "Clear Terminal" button (trash can 🗑️ icon) to the terminal panel's top-right corner.
Implementation details:
- Locate terminal component file:
modules/terminal/components/terminal.tsx
- Add a new Button component next to existing buttons (close, expand, etc.)
- Use xterm.js built-in
clear() method:
const clearTerminal = () => {
if (terminal.current) {
terminal.current.clear();
}
};
Alternatives considered
- Manual
clear command - User types "clear" in terminal (current workaround but inconvenient on mobile)
- Right-click context menu - Adds complexity and not discoverable
- Auto-clear on new command - Would remove useful history, user has no control
- Keyboard shortcut only - Not discoverable for new users, especially on mobile
Estimated scope
Small
Primary area
Playground editor
Additional context
No response
Confirmation
Problem statement
Feature Description
Add a "Clear Terminal" button to the terminal panel that clears all terminal output with one click.
Current Problem
Currently, terminal output accumulates over time. Users have to manually type the
clearcommand or refresh the page, which is not convenient, especially on mobile devices.Proposed Solution
Add a "Clear Terminal" button (trash can 🗑️ or broom 🧹 icon) to the terminal component's top-right corner (or existing button panel). When clicked:
$or>)Expected Behavior
Ctrl/Cmd + L(standard terminal convention)Alternative Approaches Considered
clearcommand (current workaround)Additional Context
clearon soft keyboardclear()methodMockup
Terminal header should have delete icon:
[Terminal] [🐚 bash] [🗑️ Clear] [✖️ Close]
Labels requested: gssoc26, gssoc:approved, level:intermediate
Proposed solution
Add a "Clear Terminal" button (trash can 🗑️ icon) to the terminal panel's top-right corner.
Implementation details:
modules/terminal/components/terminal.tsxclear()method:Alternatives considered
clearcommand - User types "clear" in terminal (current workaround but inconvenient on mobile)Estimated scope
Small
Primary area
Playground editor
Additional context
No response
Confirmation