Find a file
Yikai Liao b5ffaf1ba2
Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562)
* fix(terminal): Ensure correct handling of carriage returns for progress bars

This commit refines the tests for `TerminalProcess` to ensure the correct interpretation of terminal output containing carriage returns (`\\r`), which is essential for properly handling dynamic elements like progress bars (e.g., `tqdm`).

- Validated the `processCarriageReturns` method's behavior in simulating terminal line overwrites caused by `\\r`.
- Corrected the expectation in the `handles carriage returns in mixed content` test to accurately reflect the method's output (final line content + preserved escape sequences), confirming the logic works as intended for progress-bar-like updates.
- Fixed a minor Jest `toBe` syntax error in a related test case.
- Suppressed an expected `console.warn` in the non-shell-integration test for cleaner logs.

By ensuring `processCarriageReturns` is correctly tested, we increase confidence that the component responsible for pre-processing terminal output handles progress bars appropriately before the output is potentially used elsewhere (e.g., sent to an LLM).

* fix(test): Make TerminalProcess integration test reliable

This commit fixes the flaky test case `integrates with getUnretrievedOutput to handle progress bars` in `TerminalProcess.test.ts`.

The test previously failed intermittently due to:
1.  Relying on a fixed `setTimeout` duration to wait for asynchronous stream processing, which created a race condition.
2.  Incorrectly assuming that `await terminalProcess.run(...)` would return the final output directly via its resolved value.

The fix addresses these issues by:
-   Removing the unreliable intermediate check based on `setTimeout`.
-   Modifying the test to correctly obtain the final output by listening for the `completed` event emitted by `TerminalProcess`, which is the intended way to receive the result.

This ensures the test accurately reflects the behavior of `TerminalProcess` and is no longer prone to timing-related failures.

* Add changeset for terminal carriage return fix

* Implement terminal compress progress bar feature

This commit introduces a new feature to compress terminal output by processing carriage returns. The `processCarriageReturns` function has been integrated into the `Terminal` class to handle progress bar updates effectively, ensuring only the final state is displayed.

Additionally, the `terminalCompressProgressBar` setting has been added to the global settings schema, allowing users to enable or disable this feature.

Tests have been updated to validate the new functionality and ensure correct behavior in various scenarios.

A Benchmark is also added to test the performance.

Not that there is still no i18n support for this.

* Add i18n support for compressProgressBar setting in multiple languages

* Optimize processCarriageReturns function for performance and multi-byte character handling

This commit enhances the `processCarriageReturns` function by implementing in-place string operations to improve performance, especially with large outputs. Key features include:
- Line-by-line processing to maximize chunk handling.
- Use of string indexes and substring operations instead of arrays.
- Single-pass traversal of input for efficiency.
- Special handling for multi-byte characters to prevent corruption during overwrites.

Additionally, tests have been updated to validate the new functionality, ensuring correct behavior with various character sets, including emojis and non-ASCII text.

Highly Density CR case is added to Benchmark

* slight performance improvement by caching several variable

* Optimize multi-byte character handling in processCarriageReturns

Refactor the logic within the `processCarriageReturns` function to simplify the detection of partially overwritten multi-byte characters (e.g., emojis).

Removed redundant checks and clarified the conditions for identifying potential character corruption during carriage return processing. This improves code readability and maintainability while preserving the original functionality of replacing potentially corrupted characters with a space.

Also enforced consistent use of semicolons for improved code style.

* docs: standardize carriage return (\r) and line feed (\n) terminology
Improve code clarity by consistently adding escape sequence notation to all
references of carriage returns and line feeds throughout documentation and tests.
This makes the code more readable and avoids ambiguity when discussing these special characters.

* feat: Improve terminal output processing clarity and settings UI

- Add detailed comments to `processCarriageReturns` explaining line feed handling.
- Relocate `terminalCompressProgressBar` setting below `terminalOutputLineLimit` for better context in UI.

* Fix: Compress Progress Bar Setting Checkbox

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-04-24 00:22:47 -04:00
.changeset Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562) 2025-04-24 00:22:47 -04:00
.github Modification of AWS Bedrock to Amazon Bedrock (#2473) 2025-04-10 15:47:34 -04:00
.husky Automatically generate roo-code.d.ts (including type generation via zod-to-ts) (#2024) 2025-03-27 09:38:56 -07:00
.roo Add custom instructions for de (#2383) 2025-04-09 09:20:13 -04:00
.vscode Settings tweaks: add terminal & language sections, fix whell scroll in editor tab (#1763) 2025-03-18 00:11:57 -07:00
assets UI Glam Sesh: Makeover for TaskHeader, ChatView, HistoryPreview... (#2701) 2025-04-17 12:54:55 -04:00
audio Play sound effects for notifications and events (#38) 2024-12-01 22:25:10 -05:00
cline_docs docs: document process for adding new settings (#2552) 2025-04-12 23:54:43 -04:00
e2e Fix eslint error about --ext option by remove it (#2543) 2025-04-14 16:25:09 -07:00
evals Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562) 2025-04-24 00:22:47 -04:00
locales Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562) 2025-04-24 00:22:47 -04:00
scripts Fix Tests to run properly on Windows (#1963) 2025-03-31 23:17:56 -05:00
src Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562) 2025-04-24 00:22:47 -04:00
webview-ui Fix Terminal Carriage Return Handling for Correct Progress Bar Display (#2562) 2025-04-24 00:22:47 -04:00
.env.sample App tab layout fixes 2025-03-09 15:07:59 -07:00
.eslintrc.json Rename ClineAPI to RooCodeAPI and improve types 2025-03-10 11:16:38 -07:00
.git-blame-ignore-revs Custom modes 2025-01-21 09:39:54 -05:00
.gitattributes Add new demo 2024-10-09 02:30:38 -04:00
.gitconfig Set up ignoring revisions for git blame 2025-01-17 11:21:25 -08:00
.gitignore dev: dynamic Vite port detection for webview development (#2339) 2025-04-07 15:12:41 -04:00
.npmrc Adding basic npmrc file to avoid code artifact issues 2024-12-10 13:55:42 -08:00
.nvmrc Require node v20 everywhere (#922) 2025-03-19 10:46:40 -07:00
.prettierignore Chore: Prettier for consistant formatting (#794) 2024-11-21 13:13:54 -08:00
.prettierrc.json Chore: Prettier for consistant formatting (#794) 2024-11-21 13:13:54 -08:00
.rooignore Add telemetry and privacy policy 2025-03-07 03:03:44 -05:00
.roomodes Add custom instructions for zh-TW (#2382) 2025-04-07 14:24:23 -04:00
.tool-versions Fix: Remove 'v' prefix from Node.js version in .tool-versions file (#2515) 2025-04-11 23:09:18 -07:00
.vscodeignore Package material icons in vsix (#2882) 2025-04-23 11:21:35 -07:00
CHANGELOG.md Changeset version bump (#2777) 2025-04-18 21:14:30 -07:00
CODE_OF_CONDUCT.md Update email and attribution 2025-03-14 12:16:04 -04:00
CONTRIBUTING.md Add roadmap to CONTRIBUTING (#1883) 2025-03-21 12:27:48 -04:00
ellipsis.yaml Revert "Turn off ellipsis quiet mode" 2025-03-07 02:26:25 -05:00
esbuild.js Extension-side internationalization (#1757) 2025-03-18 10:39:21 -04:00
jest.config.js Refactor: Use path aliases in webview source files. (#2801) 2025-04-20 21:38:08 -04:00
knip.json Evals (#2238) 2025-04-02 16:49:41 -07:00
LICENSE Update LICENSE (#2275) 2025-04-03 23:54:26 -04:00
package-lock.json Split api and chat message persistence into a separate module (#2866) 2025-04-23 12:09:24 -07:00
package.json Split api and chat message persistence into a separate module (#2866) 2025-04-23 12:09:24 -07:00
package.nls.ca.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.de.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.es.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.fr.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.hi.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.it.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.ja.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.ko.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.pl.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.pt-BR.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.tr.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.vi.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.zh-CN.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
package.nls.zh-TW.json feat: Add 'roo.acceptInput' command (#2598) 2025-04-15 23:01:45 -04:00
PRIVACY.md Add telemetry and privacy policy 2025-03-07 03:03:44 -05:00
README.md Update contributors list (#2867) 2025-04-23 03:14:08 -04:00
tsconfig.json GHA fixes 2024-12-16 15:28:37 -08:00


Roo Code (prev. Roo Cline)

Connect with developers, contribute ideas, and stay ahead with the latest AI-powered coding tools.

Join Discord Join Reddit



Download on VS Marketplace Feature Requests Rate & Review Documentation

Roo Code is an AI-powered autonomous coding agent that lives in your editor. It can:

  • Communicate in natural language
  • Read and write files directly in your workspace
  • Run terminal commands
  • Automate browser actions
  • Integrate with any OpenAI-compatible or custom API/model
  • Adapt its “personality” and capabilities through Custom Modes

Whether you’re seeking a flexible coding partner, a system architect, or specialized roles like a QA engineer or product manager, Roo Code can help you build software more efficiently.

Check out the CHANGELOG for detailed updates and fixes.


🎉 Roo Code 3.13 Released

Roo Code 3.13 brings new features and improvements based on your feedback!

  • Gemini 2.5 Flash Thinking - You can now use the thinking variant of Gemini 2.5 Flash and specify a thinking token budget.
  • UI Improvements - The task header, chat view, history preview, and welcome view have been visually upgraded.
  • Bug Fixes - More reliable diff edits & more.

What Can Roo Code Do?

  • 🚀 Generate Code from natural language descriptions
  • 🔧 Refactor & Debug existing code
  • 📝 Write & Update documentation
  • 🤔 Answer Questions about your codebase
  • 🔄 Automate repetitive tasks
  • 🏗️ Create new files and projects

Quick Start

  1. Install Roo Code
  2. Connect Your AI Provider
  3. Try Your First Task

Key Features

Multiple Modes

Roo Code adapts to your needs with specialized modes:

  • Code Mode: For general-purpose coding tasks
  • Architect Mode: For planning and technical leadership
  • Ask Mode: For answering questions and providing information
  • Debug Mode: For systematic problem diagnosis
  • Custom Modes: Create unlimited specialized personas for security auditing, performance optimization, documentation, or any other task

Smart Tools

Roo Code comes with powerful tools that can:

  • Read and write files in your project
  • Execute commands in your VS Code terminal
  • Control a web browser
  • Use external tools via MCP (Model Context Protocol)

MCP extends Roo Code's capabilities by allowing you to add unlimited custom tools. Integrate with external APIs, connect to databases, or create specialized development tools - MCP provides the framework to expand Roo Code's functionality to meet your specific needs.

Customization

Make Roo Code work your way with:

Resources

Documentation

Community


Local Setup & Development

  1. Clone the repo:
git clone https://github.com/RooVetGit/Roo-Code.git
  1. Install dependencies:
npm run install:all
  1. Start the webview (Vite/React app with HMR):
npm run dev
  1. Debug: Press F5 (or Run → Start Debugging) in VSCode to open a new session with Roo Code loaded.

Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.

Alternatively you can build a .vsix and install it directly in VSCode:

npm run build

A .vsix file will appear in the bin/ directory which can be installed with:

code --install-extension bin/roo-cline-<version>.vsix

We use changesets for versioning and publishing. Check our CHANGELOG.md for release notes.


Disclaimer

Please note that Roo Code, Inc does not make any representations or warranties regarding any code, models, or other tools provided or made available in connection with Roo Code, any associated third-party tools, or any resulting outputs. You assume all risks associated with the use of any such tools or outputs; such tools are provided on an "AS IS" and "AS AVAILABLE" basis. Such risks may include, without limitation, intellectual property infringement, cyber vulnerabilities or attacks, bias, inaccuracies, errors, defects, viruses, downtime, property loss or damage, and/or personal injury. You are solely responsible for your use of any such tools or outputs (including, without limitation, the legality, appropriateness, and results thereof).


Contributing

We love community contributions! Get started by reading our CONTRIBUTING.md.


Contributors

Thanks to all our contributors who have helped make Roo Code better!

mrubens
mrubens
saoudrizwan
saoudrizwan
cte
cte
samhvw8
samhvw8
daniel-lxs
daniel-lxs
a8trejo
a8trejo
ColemanRoo
ColemanRoo
stea9499
stea9499
joemanley201
joemanley201
System233
System233
hannesrudolph
hannesrudolph
nissa-seru
nissa-seru
jquanton
jquanton
KJ7LNW
KJ7LNW
NyxJae
NyxJae
MuriloFP
MuriloFP
d-oit
d-oit
punkpeye
punkpeye
monotykamary
monotykamary
Smartsheet-JB-Brown
Smartsheet-JB-Brown
feifei325
feifei325
wkordalski
wkordalski
cannuri
cannuri
lloydchang
lloydchang
vigneshsubbiah16
vigneshsubbiah16
Szpadel
Szpadel
lupuletic
lupuletic
qdaxb
qdaxb
Premshay
Premshay
psv2522
psv2522
diarmidmackenzie
diarmidmackenzie
olweraltuve
olweraltuve
afshawnlotfi
afshawnlotfi
aheizi
aheizi
sachasayan
sachasayan
RaySinner
RaySinner
PeterDaveHello
PeterDaveHello
nbihan-mediware
nbihan-mediware
elianiva
elianiva
dtrugman
dtrugman
emshvac
emshvac
kyle-apex
kyle-apex
pdecat
pdecat
pugazhendhi-m
pugazhendhi-m
Lunchb0ne
Lunchb0ne
arthurauffray
arthurauffray
zhangtony239
zhangtony239
upamune
upamune
StevenTCramer
StevenTCramer
sammcj
sammcj
p12tic
p12tic
gtaylor
gtaylor
aitoroses
aitoroses
yt3trees
yt3trees
franekp
franekp
yongjer
yongjer
vincentsong
vincentsong
vagadiya
vagadiya
teddyOOXX
teddyOOXX
eonghk
eonghk
taisukeoe
taisukeoe
heyseth
heyseth
ross
ross
axkirillov
axkirillov
anton-otee
anton-otee
benzntech
benzntech
bramburn
bramburn
GitlyHallows
GitlyHallows
philfung
philfung
napter
napter
mdp
mdp
jcbdev
jcbdev
Chenjiayuan195
Chenjiayuan195
SplittyDev
SplittyDev
amittell
amittell
ashktn
ashktn
axmo
axmo
bannzai
bannzai
dairui1
dairui1
dqroid
dqroid
hongzio
hongzio
im47cn
im47cn
shoopapa
shoopapa
jwcraig
jwcraig
kinandan
kinandan
kohii
kohii
lightrabbit
lightrabbit
olup
olup
mecab
mecab
moqimoqidea
moqimoqidea
mosleyit
mosleyit
nevermorec
nevermorec
nobu007
nobu007
oprstchn
oprstchn
philipnext
philipnext
pokutuna
pokutuna
refactorthis
refactorthis
ronyblum
ronyblum
samir-nimbly
samir-nimbly
seedlord
seedlord
shaybc
shaybc
shohei-ihaya
shohei-ihaya
student20880
student20880
cdlliuy
cdlliuy
PretzelVector
PretzelVector
AMHesch
AMHesch
adamwlarson
adamwlarson
alarno
alarno
QuinsZouls
QuinsZouls
andreastempsch
andreastempsch
atlasgong
atlasgong
Atlogit
Atlogit
bogdan0083
bogdan0083
chadgauth
chadgauth
dleen
dleen
dbasclpy
dbasclpy
snoyiatk
snoyiatk
linegel
linegel
celestial-vault
celestial-vault
DeXtroTip
DeXtroTip
hesara
hesara
eltociear
eltociear
Jdo300
Jdo300
shtse8
shtse8
libertyteeth
libertyteeth
mamertofabian
mamertofabian
marvijo-code
marvijo-code
kvokka
kvokka
Sarke
Sarke
01Rian
01Rian
samsilveira
samsilveira
maekawataiki
maekawataiki
tgfjt
tgfjt
tmsjngx0
tmsjngx0
NamesMT
NamesMT
vladstudio
vladstudio
Yoshino-Yukitaro
Yoshino-Yukitaro

License

Apache 2.0 © 2025 Roo Code, Inc.


Enjoy Roo Code! Whether you keep it on a short leash or let it roam autonomously, we can’t wait to see what you build. If you have questions or feature ideas, drop by our Reddit community or Discord. Happy coding!