MCPcopy Index your code
hub / github.com/codeaashu/claude-code / maybeGetTmuxMouseHint

Function maybeGetTmuxMouseHint

src/utils/fullscreen.ts:180–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 * `mouse` option is off; null otherwise.
179 */
180export async function maybeGetTmuxMouseHint(): Promise<string | null> {
181 if (!process.env.TMUX) return null
182 // tmux -CC auto-disables fullscreen above, but belt-and-suspenders.
183 if (!isFullscreenActive() || isTmuxControlMode()) return null
184 if (checkedTmuxMouseHint) return null
185 checkedTmuxMouseHint = true
186 // -A includes inherited values: `show -v mouse` returns empty when the
187 // option is set globally (`set -g mouse on` in .tmux.conf) but not at
188 // session level — which is the common case. -A gives the effective value.
189 const { stdout, code } = await execFileNoThrow(
190 'tmux',
191 ['show', '-Av', 'mouse'],
192 { useCwd: false, timeout: 2000 },
193 )
194 if (code !== 0 || stdout.trim() === 'on') return null
195 return "tmux detected · scroll with PgUp/PgDn · or add 'set -g mouse on' to ~/.tmux.conf for wheel scroll"
196}
197
198/** Test-only: reset module-level once-per-session flags. */
199export function _resetForTesting(): void {

Callers 1

REPLFunction · 0.85

Calls 3

isFullscreenActiveFunction · 0.85
isTmuxControlModeFunction · 0.85
execFileNoThrowFunction · 0.85

Tested by

no test coverage detected