Enable shell_integration.osc9_9 by default on Windows (#15914)

# Description

This sets the value to true by default only on Windows. This is not a
legacy code and is used by the Windows Terminal to detect the current
directory (explicitly enabling osc7 did not work). Here are the official
docs:
https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory

# User-Facing Changes

Windows users will by default have their terminals properly detect the
current working directory without extra configuration/troubleshooting.
This commit is contained in:
Ofek Lev 2025-06-08 08:29:49 -04:00 committed by GitHub
parent 3bf96523a4
commit f92f11c0cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -17,9 +17,9 @@ impl Default for ShellIntegrationConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
osc2: true, osc2: true,
osc7: true, osc7: !cfg!(windows),
osc8: true, osc8: true,
osc9_9: false, osc9_9: cfg!(windows),
osc133: true, osc133: true,
osc633: true, osc633: true,
reset_application_mode: true, reset_application_mode: true,

View File

@ -202,11 +202,13 @@ $env.config.shell_integration.osc2 = true
# osc7 (bool): # osc7 (bool):
# Nushell will report the current directory to the terminal using OSC 7. This is useful when # Nushell will report the current directory to the terminal using OSC 7. This is useful when
# spawning new tabs in the same directory. # spawning new tabs in the same directory.
# This is disabled by default on Windows in favor of the `osc9_9` option.
$env.config.shell_integration.osc7 = true $env.config.shell_integration.osc7 = true
# osc9_9 (bool): # osc9_9 (bool):
# Enables/Disables OSC 9;9 support, originally a ConEmu terminal feature. This is an # Enables/Disables OSC 9;9 support, originally a ConEmu terminal feature. This is an
# alternative to OSC 7 which also communicates the current path to the terminal. # alternative to OSC 7 which also communicates the current path to the terminal.
# This is enabled by default on Windows as it is used by the Windows Terminal.
$env.config.shell_integration.osc9_9 = false $env.config.shell_integration.osc9_9 = false
# osc8 (bool): # osc8 (bool):