Skip to content

Conversation

@ConstantTime
Copy link

Summary

Problem

When running Goose CLI on Windows 11, the cursor was shifted to the right in the terminal due to the bold ANSI escape code not being handled correctly by Windows terminals.

Solution

Added a platform-specific check using cfg\!(target_os = "windows") to conditionally apply styling:

  • Windows: console::style("( O)>").cyan() (no bold)
  • Other platforms: console::style("( O)>").cyan().bold() (with bold)

Test Plan

  • Code compiles successfully (cargo check -p goose-cli)
  • Tested on macOS - original behavior preserved
  • Needs testing on Windows to confirm cursor position is fixed

Note

This is a draft PR as I don't have access to a Windows machine to test the fix. Would appreciate if someone with Windows could verify the cursor position is now correct.

@ConstantTime ConstantTime force-pushed the fix-windows-cursor-shift branch from 416eb38 to dcbe912 Compare August 10, 2025 05:27
Fixes block#3364 - On Windows terminals, the bold ANSI escape code in the prompt
was causing the cursor to be shifted to the right. This change removes the
bold styling specifically for Windows while maintaining it for other platforms.

The issue was in the readline prompt where console::style was applying bold
formatting that Windows terminals weren't handling correctly.
@ConstantTime ConstantTime force-pushed the fix-windows-cursor-shift branch from dcbe912 to 2c82148 Compare August 10, 2025 06:25
@ConstantTime ConstantTime marked this pull request as ready for review August 10, 2025 17:32
@ConstantTime ConstantTime marked this pull request as draft August 10, 2025 17:32
@thebristolsound
Copy link
Contributor

I was just in the process of debugging this issue myself and came across this PR. This bug renders the CLI unusable for me (no pun intended).

Wondering if this is something that can be enabled / disabled, like have an option to disable prompt styling if it's causing rendering issues. I'd rather have it fall back to safe defaults.

I'm honestly surprised more people haven't reported it.
image

@ConstantTime
Copy link
Author

I was just in the process of debugging this issue myself and came across this PR. This bug renders the CLI unusable for me (no pun intended).

Wondering if this is something that can be enabled / disabled, like have an option to disable prompt styling if it's causing rendering issues. I'd rather have it fall back to safe defaults.

I'm honestly surprised more people haven't reported it. image

Hey @thebristolsound
Thanks for the insight and sorry for late reply. Were you able to test the build out of this PR on your windows machine? We can get this fix in if we have a working proof for this.

@thebristolsound
Copy link
Contributor

I'll get local dev setup and test it out, will let you know

@ConstantTime
Copy link
Author

I'll get local dev setup and test it out, will let you know

Thanks!

@thebristolsound
Copy link
Contributor

Just a heads up, I went ahead and created a pull request addressing this issue and added some test coverage onto it. Got two approvals and just waiting for next steps:

#4464

@ConstantTime
Copy link
Author

Just a heads up, I went ahead and created a pull request addressing this issue and added some test coverage onto it. Got two approvals and just waiting for next steps:

#4464

Cool. Closing my PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor shifted to the right using native windows CLI

2 participants