Skip to content

Conversation

@avinashsivaraman
Copy link

@avinashsivaraman avinashsivaraman commented Nov 3, 2025

Description of changes:

Add support for configuring external diff tools to view file changes in preferred editor/IDE instead of terminal.

Features:

  • Q_DIFF_TOOL environment variable for tool configuration
  • Support for file write approval diffs only
  • Automatic fallback to inline diff when not configured

Usage:
export Q_DIFF_TOOL="code --diff" # VSCode
export Q_DIFF_TOOL="vimdiff" # vimdiff

Integration points:

  • File write tool: approval flow diffs

Implementation:

  • New diff_tool module with launch and content handling

🤖 Assisted by Amazon Q Developer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add support for configuring external diff tools to view file changes
in preferred editor/IDE instead of terminal.

Features:
- Q_DIFF_TOOL environment variable for tool configuration
- Support for file write approval diffs only
- Automatic fallback to inline diff when not configured

Usage:
  export Q_DIFF_TOOL="code --diff"  # VSCode
  export Q_DIFF_TOOL="idea diff"    # JetBrains

Integration points:
- File write tool: approval flow diffs

Implementation:
- New diff_tool module with launch and content handling

🤖 Assisted by Amazon Q Developer

https://issues.amazon.com/issues/P129406383
```bash
> export Q_DIFF_TOOL="delta --color-only"
> q chat
```
Copy link
Contributor

@evanliu048 evanliu048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @avinashsivaraman ! I really like this feature — it makes using the CLI with the IDE super convenient while coding.
One quick question: if a user accidentally closes the diff file, how can they view it again?
Should we also consider printing the diff in the terminal?
Curious to hear your thoughts!

@avinashsivaraman
Copy link
Author

Hey @avinashsivaraman ! I really like this feature — it makes using the CLI with the IDE super convenient while coding. One quick question: if a user accidentally closes the diff file, how can they view it again? Should we also consider printing the diff in the terminal? Curious to hear your thoughts!

I can think of two options here

  1. They can ask the Q to generate the diff again.
  2. We provide the option to show diff again while getting the approval from user. Today, we provide trust, yes & no. Probably we can add diff to show the diff again.

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.

2 participants