Skip to content

Conversation

@joycelu9087
Copy link

Issue #, if available:

Fixes #2723
Feature: Show current folder/project in the Terminal title

Description of changes:

  • Added logic to make the terminal title for q chat show the current folder name.
  • Added a helper function set_terminal_title_for_cwd() in crates/chat-cli/src/cli/chat/mod.rs.
  • Called this helper at the start of ChatArgs::execute() so it runs when q chat starts.
  • The title now displays as q (), for example q (ecommerce) instead of q (qchat).
  • Skips emitting the escape sequence when stdout is not a TTY to avoid leaking characters into pipes.

Before:
All terminals were titled q (qchat), which made multiple sessions hard to tell apart.

After:
Each session shows its folder name in the title bar, e.g.:
q (amazon-q-developer-cli)

Testing

  • Ran cargo run in different directories and confirmed the terminal title updates correctly.
  • Confirmed behavior on macOS Terminal.
  • Local tests all pass
Screen Shot 2025-11-08 at 9 21 58 PM

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

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.

Feature: Show current folder/project in the Terminal title

1 participant