waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Feature]: Enhance window title to include context (AI session, command, web page title) for IME automation

Open DannyBaobei opened this issue 6 months ago • 0 comments

Feature description

Problem

Currently, the window title of WaveTerm is generic (e.g., "WaveTerm" or "Terminal"). This makes it difficult for external automation tools (like AutoHotkey, PowerToys, or WinInput) to determine the appropriate IME (Input Method Editor) state based on context.

For example:

  • When typing code in a terminal running npm run dev, English IME should be active.
  • When chatting with an AI assistant, Chinese IME might be preferred.
  • When viewing a web page like "Gmail - Inbox", the input context matters.

Without detailed window titles, automation tools cannot distinguish these scenarios.

Proposal

Enhance the window title to dynamically reflect current context, such as:

  • AI Chat: WaveTerm - Chat: Summarize this article
  • Terminal: WaveTerm - Command: npm run dev | ProjectX
  • Web Tab: WaveTerm - Web: GitHub - neovim/neovim

This would allow external tools to:

  • Parse the title with regex
  • Detect whether the user is coding, chatting, or browsing
  • Automatically switch IME (e.g., to English for coding, leave Chinese for chatting)

Use Case

I use AutoHotkey to auto-switch IME based on active window title. With this change, I can write rules like:

; Switch to English IME when coding
IfWinActive, WaveTerm - Command: npm
    SwitchToEnglishIME()

; Keep Chinese IME in AI chat
IfWinActive, WaveTerm - Chat:
    return

### Implementation Suggestion

_No response_

### Anything else?

_No response_

DannyBaobei avatar Aug 19 '25 04:08 DannyBaobei