core-agent-ide/codex-cli/src
nerdielol 797eba4930
fix: /clear now clears terminal screen and resets context left indicator (#425)
## What does this PR do?
* Implements the full `/clear` command in **codex‑cli**:
  * Resets chat history **and** wipes the terminal screen.
  * Shows a single system message: `Context cleared`.
* Adds comprehensive unit tests for the new behaviour.

## Why is it needed?
* Fixes user‑reported bugs:  
  * **#395**  
  * **#405**

## How is it implemented?
* **Code** – Adds `process.stdout.write('\x1b[3J\x1b[H\x1b[2J')` in
`terminal.tsx`. Removed reference to `prev` in `
        setItems((prev) => [
          ...prev,
` in `terminal-chat-new-input.tsx` & `terminal-chat-input.tsx`.

## CI / QA
All commands pass locally:
```bash
pnpm test      # green
pnpm run lint  # green
pnpm run typecheck  # zero TS errors
```

## Results



https://github.com/user-attachments/assets/11dcf05c-e054-495a-8ecb-ac6ef21a9da4

---------

Co-authored-by: Thibault Sottiaux <tibo@openai.com>
2025-04-21 12:39:46 -04:00
..
components fix: /clear now clears terminal screen and resets context left indicator (#425) 2025-04-21 12:39:46 -04:00
hooks chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
utils fix: /clear now clears terminal screen and resets context left indicator (#425) 2025-04-21 12:39:46 -04:00
app.tsx add support for -w,--writable-root to add more writable roots for sandbox (#263) 2025-04-17 15:39:26 -07:00
approvals.ts chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
cli-singlepass.tsx fix: standardize filename to kebab-case 🐍➡️🥙 (#302) 2025-04-17 20:25:44 -07:00
cli.tsx chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
format-command.ts Back out @lib indirection in tsconfig.json (#111) 2025-04-16 14:16:53 -07:00
parse-apply-patch.ts chore: consolidate patch prefix constants in apply‑patch.ts (#274) 2025-04-17 17:00:30 -07:00
text-buffer.ts chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
typings.d.ts Initial commit 2025-04-16 12:56:08 -04:00