mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-04 05:35:20 +00:00
Open new terminal tab in same directory as existing tab (OSC 7?) #4405
Open
opened 2026-01-30 23:46:08 +00:00 by claunia
·
189 comments
No Branch/Tag Specified
main
automated/loc-update
feature/llm
dev/cazamor/sui/search
dev/pabhoj/actions_editor_search
dev/lhecker/11509-kitty-keyboard-protocol
dev/lhecker/11509-kitty-keyboard-protocol-wip
dev/pabhoj/actions_editor_visual
dev/cazamor/selfhost/2026-01-29
dev/duhowett/no-blank-issues-you-lost-privileges-for-that-fam
dev/lhecker/benchcat-fix
dev/lhecker/dcs-perf
dev/duhowett/eoy-25/allow-set-foreground
release-1.24
release-1.23
dev/cazamor/bot/deprecate-area-atlasengine
dev/pabhoj/actions_editor_followups
dev/cazamor/selfhost/2026-01-20
dev/cazamor/selfhost/2026-01-12
dev/cazamor/spec/auto-save
dev/duhowett/eoy-25/underline-colors-in-atlas-bug-redux
dev/duhowett/fhl-2024/asciicast-recorder
dev/duhowett/eoy-25/underline-colors-in-atlas-bug
dev/duhowett/hax/serial-port-support
dev/duhowett/connection-utf8
dev/lhecker/fused-event
dev/lhecker/18928-wip
dev/duhowett/fhl-2024/clang
dev/cazamor/uia-leak
dev/duhowett/win7-wpf-termcontrol-squash
release-1.22
dev/cazamor/selfhost/11-18-v3
dev/cazamor/selfhost/11-18
dev/duhowett/fhl-2025/bitmap-fonts
dev/duhowett/server-2025-vms
dev/duhowett/cant-believe-gotta-do-this-shit
dev/lhecker/1410-large-scrollback
dev/lhecker/dark-mode
dev/cazamor/sui/invert-cursor-color
dev/duhowett/fhl-2025/wt-command-palette-cmdpal-integration
dev/duhowett/fhl-2025/wt-json-relative-icons
dev/lhecker/fucking-service-locator
dev/duhowett/unicode-17
dev/duhowett/multi-blern
dev/lhecker/wellp2-alt
dev/duhowett/wellp2
dev/lhecker/1860-horizontal-scrollbar
dev/lhecker/fix-window-count
dev/cazamor/sui/tab-color-old
dev/duhowett/hax/conhost-icon
dev/duhowett/hax/sui-color-chip-border
dev/duhowett/hax/terminalsettings-as-a-lib-/with-types-merged-into-tsm
dev/pabhoj/page_control_input_cleanup
dev/duhowett/padding-in-atlas-rebase-20250729
dev/lhecker/attach-thread-input
dev/duhowett/portable-shader-members
msbuildcache-reenable
dev/cazamor/selfhost/1.24-2025-06-10
dev/cazamor/upgrade-settings-containers
dev/cazamor/sui/ext-page/powershell-stub
dev/cazamor/selfhost/1.24-2025-05-15
dev/pabhoj/sui_action_overhaul
dev/cazamor/selfhost/1.24-2025-05-06
dev/cazamor/selfhost/1.24-2025-04-29
dev/cazamor/sui/ext-page/lazy-load-objects
dev/cazamor/sui/ext-page/badge
dev/cazamor/selfhost/1.24
dev/lhecker/sdk-26100
dev/duhowett/testing
dev/jadelaga/VS-Pty.Net-1.22
dev/duhowett/fhl-2025/what-if-no-content-ids
dev/cazamor/a11y/vt-seq-prototype
dev/lhecker/18584-part2
dev/lhecker/get-lang-id
dev/duhowett/hax/clogs
release-1.21
dev/pabhoj/featurellm_fix_paste
dev/lhecker/grapheme-backup
dev/jadelaga/VS-Pty.netFixes
dev/lhecker/atlas-engine-compute-shader
dev/migrie/s/ai-providers
dev/lhecker/animated-cursor-wip
dev/pabhoj/featurellm_timeout
dev/lhecker/dark-mode-alt
dev/duhowett/osc-strided-table
dev/lhecker/bugbash
dev/pabhoj/featurellm_improve_parsing
dev/duhowett/coast-to-coast
dev/lhecker/curly-improvements
dev/duhowett/net8
dev/duhowett/onebranch-custom-pool
dev/lhecker/renderer-overhaul-2nd-attempt
dev/lhecker/cleanup
dev/cazamor/sui/confirmation-announcements
dev/lhecker/theme-quality
dev/duhowett/hax/cmake
dev/lhecker/winconpty-cleanup
dev/duhowett/learn/rewrite-highlights
dev/migrie/b/no-nesting-when-searching
release-1.20
dev/lhecker/14165-conhost-font-size
dev/duhowett/sel-2-spans
dev/lhecker/7118-cursor-color
dev/lhecker/remove-glyph-width
dev/lhecker/igfw-scroll-region
dev/lhecker/17656-win32im-double-encoding
dev/duhowett/fhl-2024/merge-idls
dev/duhowett/feed-forward-variables
dev/lhecker/remove-chrome-math
dev/duhowett/copylink
dev/duhowett/applicableactions
gh-readonly-queue/main/pr-17566-de50310295b7d92ed3d51f07974a2a945776bf9d
dev/lhecker/atlas-engine-stride-copy
dev/migrie/b/bump-nuget-in-c
dev/migrie/f/992-redux-redux
dev/migrie/f/filter-weight-input-too
dev/migrie/f/disable-nesting
dev/migrie/f/local-snippets-cleaner
dev/migrie/s/1553-mouse-bindings
selfhost-1.22-bugbash-2024-06-04
selfhost/1.22-bugbash-2024-06-04
dev/lhecker/15689-tab-drag-crash-fix
dev/migrie/f/sxnui-font-size-change
dev/migrie/f/local-snippets-on-action-refactor
dev/migrie/f/just-local-snippets
dev/migrie/save-input-patches
dev/migrie/f/md-pane-official
dev/migrie/base-pane
dev/migrie/fhl/tasks-pane
release-1.19
dev/migrie/b/17130-clear-marks-2
dev/migrie/b/17075-its-me-the-killer
dev/duhowett/i-figured-out-why-sometimes-the-publish-build-failed
dev/duhowett/nuget-publication-with-aad-app-id
selfhost-1.20
dev/duhowett/graph
dev/migrie/b/15803-activate-dont-copypasta
dev/duhowett/is-pgo-broken-because-of-sui-being-slower
dev/migrie/b/remove-terminaltab
dev/migrie/fhl/md-pane
dev/migrie/fhl/local-tasks-2024
dev/migrie/fhl/2024-inline-notebook
dev/duhowett/interface-projects
dev/duhowett/dead-loc
release-1.18
dev/migrie/fhl/2024-spring-merge-base
dev/duhowett/hax/l9
inbox
dev/migrie/14073-on-main
dev/duhowett/hax/conhost_dump_replay
user/lhecker/atlas-engine-srgb
dev/migrie/fhl/sxnui-tooltips-3
dev/migrie/7718-notifications-experiments
dev/migrie/fhl/7718-notifications
dev/migrie/fhl/7718-notifications-reboot
dev/lhecker/remove-gsl
dev/lhecker/16575-TerminateProcess
dev/lhecker/window-thread-climate-control
dev/lhecker/client-context-input-output-mode
dev/lhecker/ring-buffer-input-buffer
release-1.17
dev/lhecker/propsheet-fontdlg-refactor
dev/lhecker/renderer-overhaul
dev/pabhoj/test
dev/duhowett/chop
dev/lhecker/til-ulong-cleanup
dev/lhecker/til-env-cleanup
dev/migrie/f/16005-a11y-pane
dev/cazamor/a11y/fastpass
dev/migrie/b/15487-push-cwd
dev/migrie/b/15536-or-15219-idk
dev/duhowett/move-timers-down-into-core-interactivity-etc
dev/migrie/b/15812-broadcast-paste-two
dev/migrie/fhl-fall-2023/11162-quake-III-arena
dev/migrie/fhl-fall-2023/1620-automatic-tab-progress
dev/migrie/fhl-fall-2023/9992-quake-II
dev/migrie/fhl-fall-2023/9992-default-quake-settings
dev/migrie/fhl-fall-2023/9992-window-name-settings
dev/migrie/fhl-fall-2023/oceans
dev/lhecker/ColorScheme-improvements
dev/migrie/search-v2-v3
dev/migrie/pr-15717/its-dangerous-to-go-alone
dev/migrie/f/4768-taskbar-icons
dev/duhowett/padding-in-atlas
dev/migrie/f/3121-tooltips
dev/duhowett/sticky-control
dev/duhowett/fix-tracing-2
dev/migrie/b/add-support-for-vsc-marks
dev/migrie/f/1860-this-is-literally-what-less-is-for
dev/migrie/s/5916-draft
dev/lhecker/tracy
dev/migrie/s/north-star
dev/cazamor/tag-youre-it
dev/migrie/f/12336-let-it-mellow
dev/migrie/f/now-with-more-compat-settings
dev/migrie/f/compatibility-sui
dev/duhowett/hax/wpf-atlas
dev/duhowett/fgb
dev/migrie/b/15487-relative-paths-are-hard
dev/lhecker/colrv1
loc-update
dev/migrie/fhl/dyndep-csharp
dev/migrie/fhl/dyndep
dev/migrie/fhl-clickable-send-input
dev/migrie/f/cwd-hijinks-5506-15173
dev/lhecker/openconsole-async-start
1.17
dev/migrie/bump-scratch
dev/migrie/f/3726-restartConnection
dev/migrie/b/cxn-restarting-attempt-1-backport
dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing
dev/migrie/b/13388-focus-logger
dev/migrie/b/9053-part-4-i-guess-defterm
dev/migrie/oop/3/of-the-silmarils
of-the-darkening-of-valinor
dev/migrie/fhl/notebook-proto-000
dev/migrie/f/narrator-buddy
dev/migrie/mux-2.8.2-march-2023
dev/migrie/f/roast-mutton
dev/migrie/f/12861-preview-input
dev/lhecker/clang-tidy
dev/migrie/f/3121-wE-dOnT-hAvE-dEv-DaYs
dev/duhowett/compiler-compliance
dev/duhowett/i-have-a-burning-hatred-for-ntstatus-of-later-so-why-not-fix-it
dev/duhowett/shorthand-namespaces
dev/duhowett/rename-all-dlls
dev/duhowett/errordialog
dev/lhecker/gsl-narrow
dev/migrie/b/11522-dumb-idea
release-1.16
dev/miniksa/env
dev/duhowett/hax/embed-everything
dev/migrie/b/13388-attempt-003
dev/migrie/b/14512-test-research
dev/migrie/b/13388-attempt-002
dev/migrie/b/14464-copyOnSelect-moving-text
dev/migrie/s/thema-schema-for-1.16
dev/migrie/s/theme-pair-schema
dev/migrie/b/13388-experiments-1
dev/cazamor/spec/a11y-vt-seq
dev/migrie/b/14557-empty-folder-dropdown
dev/cazamor/spec/a11y-vt-seq-v2
release-1.15
dev/migrie/f/process-model-v3-test-0
dev/lhecker/vsconfig
dev/migrie/s/5000-presentation
dev/lhecker/5907-startup-perf
dev/lhecker/winrt-file-api-benchmark
dev/duhowett/128-bit-compiler
dev/duhowett/hax/arm64-native-build
dev/migrie/fhl/more-shell-integration
dev/migrie/b/13388-experiments-0
dev/lhecker/til-to-ulong-improvements
dev/migrie/s/markdown-notebooks
dev/cazamor/a11y/nav-by-page
dev/cazamor/a11y/system-menu-support
dev/duhowett/no-private-registry-keys
dev/cazamor/wpf/uia-expose-enable-events
dev/cazamor/wpf/uia-events
extendAISpec
dev/migrie/fhl/clickSendInput
dev/migrie/fhl/save-command
dev/migrie/b/theme.profile
dev/migrie/b/13943-a-test-for-this
dev/migrie/oop/2/endgame
dev/duhowett/hax/merge_idl
dev/migrie/oop/2/infinity-war
dev/migrie/spellbot-cve
dev/cazamor/a11y-sev3/new-profile-announcement
dev/migrie/fhl/upside-down-mode
release-1.14
dev/migrie/f/9458-startupInfoToTerminal
dev/migrie/fhl/5916-triggers
dev/migrie/b/13523-context-menu
dev/migrie/b/6523-endpaint-outside-lock
dev/migrie/b/12413-OnUnhandledException
dev/lhecker/render-snapshot
dev/cazamor/1.15/scroll-to-point
dev/migrie/mux-2.8-aug-2022
dev/lhecker/lock-console-guard
dev/migrie/f/1504-final
dev/pabhoj/sui_follow_ups
dev/migrie/f/til-winrt.h
dev/cazamor/color-picker-redesign
dev/migrie/fhl/vscode-autocomplete-prototype
dev/migrie/f/1504-prototype
dev/migrie/oop/2/loki
dev/migrie/oop/2/wandavision
dev/migrie/b/8698-YOURE-OUT-OF-ORDER
fabricbot-configuration-migration
dev/migrie/b/12788-did-it-work
dev/migrie/b/localtests-ci-2022
dev/cazamor/1.14/replace-compareInBounds
dev/pabhoj/preview_string
dev/cazamor/ks/switchSelectionEndpoint
dev/migrie/oop/2/COM-ISwapChainProvider-attempt-1
dev/migrie/b/dxd-marker
release-1.13
dev/migrie/b/13066-for-defterm
dev/cazamor/revert-dwm
dev/migrie/b/13066-sw_flash_repeatedly
dev/migrie/b/no-cloaky-cloak
dev/migrie/f/apples-to-oranges
dev/migrie/f/no-custom-caption-btns
dev/migrie/f/10509-mica-and-transparent-titlebars
dev/migrie/b/12911-wpf-focus-fg
dev/migrie/titebar-colors
dev/lhecker/4015-cursor
dev/migrie/fhl/rgb-rainbow-window-frame
dev/migrie/fhl/scroll-marks-prototype
release-1.12
dev/miniksa/compliance
dev/migrie/f/default-icons
dev/migrie/fhl/10175-web-search-for-text
dev/migrie/fhl/menu-complete-prototype
dev/migrie/b/2988-merged-prototypes
dev/migrie/b/2988-niksa-msgs-prototype
dev/migrie/fhl/9583-colorSelection
dev/migrie/b/10609-sui-leak
dev/migrie/b/32-attempt-3
dev/migrie/release-1.12-rejuv-attempt-2
dev/migrie/demo-for-presentation
dev/migrie/b/32-but-im-here-for-12567
dev/duhowett/conpty_first_frame_blug
dev/migrie/b/11092-unfocused-acrylic-settings
dev/migrie/localtests-in-ci
dev/migrie/b/12356-attempt-2
dev/migrie/b/12353-with-null
dev/migrie/b/12387-trim-spaces
dev/migrie/b/5033-bad-start
dev/lhecker/12351-broken-locales
dev/migrie/b/8663-input-to-oem-crash
dev/migrie/b/11743-win10-opacity-is-hard
dev/migrie/f/ctrl-click-elevate
dev/migrie/b/12196-shim-localization
dev/lhecker/issue-4015-til-rect
dev/cazamor/eim/mvvm
dev/migrie/f/--elevate
dev/migrie/b/11668-i-think
dev/migrie/b/11994-wsl-mangline
dev/migrie/eim/3475-action-xmacros
dev/migrie/eim/incremental-build-000
dev/cazamor/a11y/fake-uia-data
dev/migrie/f/non-terminal-content-elevation-warning
dev/migrie/f/632-on-warning-dialog
dev/lhecker/rgba
dev/migrie/b/8480-keybindings-in-tabs
release-1.11
dev/migrie/b/11561-dead-ends
dev/migrie/oct-21-roadmap-update
dev/migrie/fhl/adaptive-card-extension
dev/cazamor/test/11440
dev/migrie/f/warning-dlg-automation
dev/migrie/b/1.12-crash-on-exit
dev/migrie/b/11146-next-tab-in-cmdpal
release-1.10
dev/migrie/5ff9a24-and-75e2b5f
dev/duhowtt/hax/cpal-jumplist-async
dev/lelian/actionid/1
dev/migrie/f/just-elevated-state
dev/lhecker/terminal-settings-cleanup
dev/migrie/gh-10824
dev/pabhoj/cursor_light
dev/migrie/oop/wandavision
dev/migrie/oop/endgame
dev/migrie/oop/infinity-war
dev/lhecker/app-state-actually-hidden
dev/migrie/b/6160-dynamic-default-warning
dev/mgirie/b/more-nchhittest-ideas
dev/migrie/b/9320-interfacial-separation
cinnamon/fhl/find-contextmenu
dev/lhecker/wsl-distro-generator-cleanup
dev/migrie/b/10875-but-more-clever
dev/migrie/b/broken-globalsummon-overloading
dev/duhowett/hax/rle-row
dev/migrie/fhl-2021/cmdpal-select-list
dev/migrie/fhl-2021/differential-pixel-shading
dev/duhowett/hax/no-writable-glyphat
dev/migrie/fhl-2021/more-shader-variables
dev/migrie/titlebar-shenannigans
dev/miniksa/win10_font_matching
dev/lhecker/conhost-oom
dev/migrie/b/10332-less-snappy-scrolling
dev/migrie/b/7422-1px-top-border
release-1.9
dev/cazamor/move-scratch
release-1.8
dev/miniksa/manifest_2
release-1.6
release-1.7
dev/migrie/oop/the-whole-thing
dev/migrie/oop/connection-factory
dev/migrie/f/quake-dropdown-2
dev/miniksa/rle2
dev/migrie/f/quake-toCurrent-experiments-2
dev/migrie/f/quake-toCurrent-experiments
dev/migrie/f/quake-dropdown
dev/cazamor/actions-page/template
dev/duhowett/hax/cursor_stamp_foreground_background
dev/migrie/f/1860-hey-might-was-well-hack-during-a-hackathon
dev/migrie/oop-terminal.control-split-control
dev/duhowett/hax/build-with-wholearchive
dev/cazamor/spec/tsm-actions-temp
dev/migrie/oop-tear-apart-control
dev/migrie/oop-scratch-3
dev/cazamor/sui/bugfix-reload-crash
dev/migrie/f/xmacro
dev/cazamor/sui/proto/profile-nav-view
dev/migrie/f/name-windows
dev/migrie/dol/messing-with-shaders-take-1
release-1.5
dev/cazamor/sui/inheritance-hyperlinks-test
dev/migrie/r/commandline-lib-002
dev/migrie/f/com.fabrikam.toaster
dev/cazamor/adaptive-cards-prototype
dev/migrie/f/commandline-lib
dev/miniksa/zipzoom2
dev/migrie/f/remote-commandlines
dev/migrie/f/632-elevated-profiles
dev/migrie/oop-broker-000
dev/migrie/fix-pr-7015
dev/duhowett/clang
dev/miniksa/input_tests_2
dev/miniksa/input2
dev/migrie/oop-rpc-000
release-1.4
dev/migrie/oop-mixed-elevation-1
dev/migrie/oop-window-content-1
cinnamon/open-json
dev/miniksa/input_tests
dev/duhowett/hax/tsm-graphviz
dev/miniksa/input
dev/duhowett/hax/caption_buttons
release-1.3
dev/cazamor/a11y/expand-line-under-viewport
dev/cazamor/acc/ch/word-nav-perf
dev/cazamor/spec/settings-ui-architecture-draft
dev/duhowett/hax/tap_upgrade
dev/migrie/f/pane-exit-animation
release-1.2
dev/migrie/move-lib-up-and-dll-down
release-1.1
dev/migrie/f/branch-2-backup
dev/migrie/f/settings-getters-only
dev/duhowett/hax/command_palette_search
dev/migrie/f/6856-let-terminalpage-expandcommands
dev/migrie/f/theming-2020
dev/migrie/oop-scratch-4
dev/duhowett/hax/punchout
dev/migrie/s/action-ids
dev/migrie/f/lets-just-generate-these
dev/migrie/oop-scratch-2
dev/miniksa/dcomp
dev/miniksa/gotta_go_fast_spsc
dev/miniksa/gotta_go_fast
dev/miniksa/perf_skip_checks
dev/miniksa/perf_buffer_dig
dev/migrie/s/1203-cursorTextColor
dev/migrie/f/fix-intellisense-i-guess-backup
release-1.0
dev/migrie/f/execute-commandlines
dev/migrie/f/2046-Command-Palette-v2
dev/migrie/b/6421-passthrough-alt
dev/migrie/b/moving-focus-is-hard
dev/miniksa/set
dev/migrie/f/1203-phase-1
dev/migrie/f/get-localtests-in-ci
dev/cazamor/drag-panes
dev/cazamor/tile-background
release-0.11
dev/duhowett/dev/duhowett/hax/appstate_remember
dev/duhowett/load_condrv
dev/duhowett/hax/wpf_win_8_hax
dev/migrie/b/3088-weird-exact-wrap-resize
release-0.10
dev/migrie/b/4591-custom-scaling-bug
dev/duhowett/hax/attr_smuggling
dev/migrie/b/5161-mingw-vim-fix
dev/miniksa/dx_bitmap
dev/migrie/b/1503-try-messing-with-cooked-read
dev/duhowett/eyebeam
dev/migrie/b/5113-experiments
dev/duhowett/hax-selection-exclusive
dev/migrie/f/more-vt-renderer-tracing
dev/miniksa/bitmap
dev/duhowett/wprp
dev/miniksa/bitmap-mad-with-power
dev/migrie/f/resize-quirk
dev/migrie/f/reflow-buffer-on-resize-002
wpf-renderer-revert
dev/miniksa/draw
release-0.9
dev/miniksa/tabs-color-fix
dev/miniksa/4309
dev/migrie/f/just-wrapping
dev/migrie/b/3490-try-another-resize-algo
release-0.8
dev/migrie/b/3490-a-simpler-resize
dev/migrie/b/3490-resize-down
dev/miniksa/4254
dev/migrie/f/conpty-wrapped-lines-2
dev/migrie/b/be-better-at-hiding
dev/migrie/f/3327-xaml-theming-proto
dev/miniksa/gardening2
release-0.7
dev/duhowett/conpty-flags
dev/migrie/f/603-vintage-opacity
dev/migrie/PR#3181-comments
dev/duhowett/font-64
release-0.5
dev/migrie/b/663-paste-lf-always
dev/migrie/b/2011-reordered-fallthrough-strings
dev/migrie/b/411-init-tab-stops
dev/migrie/b/json-patching-is-hard
dev/migrie/b/2455-try-getting-tests-working
dev/migrie/b/1223-change-256-table
dev/migrie/f/2171-openterm.cmd
dev/migrie/f/drag-panes
dev/migrie/f/2046-command-palette
release-0.3
dev/miniksa/manager
dev/migrie/f/non-terminal-panes
dev/migrie/f/passthrough-2019
dev/miniksa/shared_pch
dev/migrie/f/1897-less-duplicated-work
release-0.2
dev/cazamor/mcs/viewport-selection
dev/duhowett/version_hack
v1.24.10212.0
v1.23.20211.0
v1.24.3504.0
v1.23.13503.0
v1.24.2812.0
v1.23.12811.0
v1.24.2682.0
v1.23.12681.0
v1.24.2372.0
v1.23.12371.0
v1.23.12102.0
v1.22.12111.0
v1.23.11752.0
v1.22.11751.0
v1.22.11141.0
v1.23.11132.0
v1.23.10732.0
v1.22.10731.0
v1.21.10351.0
v1.22.10352.0
v1.23.10353.0
v1.22.3232.0
v1.21.3231.0
v1.22.2912.0
v1.21.2911.0
v1.22.2702.0
v1.21.2701.0
v1.22.2362.0
v1.21.2361.0
v1.21.1772.0
v1.20.11781.0
v1.21.1382.0
v1.20.11381.0
v1.21.1272.0
v1.20.11271.0
v1.20.11215.0
v1.19.11213.0
v1.20.10822.0
v1.19.10821.0
v1.20.10572.0
v1.19.10573.0
v1.20.10303.0
v1.19.10302.0
v1.18.10301.0
v1.20.10293.0
v1.19.10292.0
v1.18.10291.0
v1.18.3181.0
v1.19.3172.0
v1.19.2831.0
v1.18.2822.0
v1.19.2682.0
v1.18.2681.0
v1.18.1462.0
v1.17.11461.0
v1.18.1421.0
v1.17.11391.0
v1.17.11043.0
v1.16.10261.0
v1.17.1023
v1.16.10231.0
v1.15.3465.0
v1.16.3463.0
v1.15.2712.0
v1.15.2874.0
v1.16.2641.0
v1.16.2523.0
v1.15.2524.0
v1.15.2282.0
v1.14.2281.0
v1.14.1962.0
v1.15.2002.0
v1.15.2001.0
v1.15.1862.0
v1.14.1861.0
v1.14.1451.0
v1.14.1432.0
v1.13.11431.0
v1.13.10983.0
v1.12.10982.0
v1.13.10733.0
v1.12.10732.0
v1.13.10395.0
v1.12.10393.0
v1.13.10336.0
v1.12.10334.0
v1.12.3472.0
v1.11.3471.0
v1.12.2931.0
v1.12.2922.0
v1.11.2921.0
v1.11.2731.0
v1.10.2714.0
v1.11.2421.0
v1.10.2383.0
v1.10.1933.0
v1.9.1942.0
v1.9.1523.0
v1.8.1521.0
v1.9.1445.0
v1.8.1444.0
v1.8.1092.0
v1.7.1091.0
v1.8.1032.0
v1.7.1033.0
v1.7.572.0
v1.6.10571.0
v1.5.10411.0
v1.6.10412.0
v1.6.10272.0
v1.5.10271.0
v1.5.3242.0
v1.4.3243.0
v1.5.3142.0
v1.4.3141.0
v1.4.2652.0
v1.3.2651.0
v1.3.2382.0
v1.2.2381.0
v1.1.2233.0
v1.2.2234.0
v1.1.2021.0
v1.2.2022.0
v1.1.1812.0
v1.0.1811.0
v1.1.1671.0
v1.0.1401.0
v0.11.1333.0
v0.11.1251.0
v0.11.1191.0
v0.11.1111.0
v0.11.1121.0
v0.10.781.0
v0.10.761.0
v0.9.433.0
v0.8.10261.0
v0.8.10091.0
v0.7.3451.0
v0.7.3382.0
v0.7.3291.0
v0.7.3252.0
v0.6.3181.0
v0.6.2951.0
v0.6.2911.0
v0.5.2762.0
v0.5.2761.0
v0.5.2681.0
v0.5.2661.0
v0.3.2321.0
v0.4.2342.0
v0.4.2382.0
v0.3.2171.0
v0.3.2142.0
v0.2.1831.0
v0.2.1715.0
v0.2.1703.0
v0.1.1621.0
v0.1.1581.0
v0.1.1502.0
v0.1.1431.0
v0.1.1361.0
v0.1.1093.0
v0.1.1161.0
v0.1.1204.0
experiment-master
v0.1.1025.0
experiment-OutsideBuild
broken-tabstops
RS2-final
v0.1.1002.0
experiment-rel-windows-inbox
experiment-f-ServerApp
v0.1.1211.0
1904.29002
1810.02002
1708.14008
Labels
Clear labels
⛺ Reserved
A11yCO
A11yMAS
A11ySev1
A11ySev2
A11ySev3
A11yTTValidated
A11yUsable
A11yVoiceAccess
A11yWCAG
Area-Accessibility
Area-AtlasEngine
Area-AzureShell
Area-Build
Area-Build
Area-Chat
Area-CmdPal
Area-CodeHealth
Area-Commandline
Area-CookedRead
Area-DefApp
Area-Extensibility
Area-Fonts
Area-GroupPolicy
Area-i18n
Area-Input
Area-Interaction
Area-Interop
Area-Localization
Area-Output
Area-Performance
Area-Portable
Area-Quality
Area-Remoting
Area-Rendering
Area-Schema
Area-Server
Area-Settings
Area-SettingsUI
Area-ShellExtension
Area-ShellExtension
Area-ShellExtension
Area-Suggestions
Area-Suggestions
Area-TerminalConnection
Area-TerminalControl
Area-Theming
Area-UserInterface
Area-VT
Area-Windowing
Area-WPFControl
AutoMerge
Blocking-Ingestion
Culprit-Centennial
Culprit-WinUI
Disability-All
Disability-Blind
Disability-LowVision
Disability-Mobility
External-Blocked-WinUI3
Fixed
Gathering-Data
good first issue
HCL-E+D
HCL-WindowsTerminal
Help Wanted
Impact-Compatibility
Impact-Compliance
Impact-Correctness
Impact-Visual
In-PR
InclusionBacklog
InclusionBacklog-Windows TerminalWin32
InclusionCommitted-202206
Issue-Bug
Issue-Docs
Issue-Feature
Issue-Feature
Issue-Question
Issue-Samples
Issue-Scenario
Issue-Task
Needs-Attention
Needs-Author-Feedback
Needs-Bisect
Needs-Discussion
Needs-Repro
Needs-Tag-Fix
Needs-Tag-Fix
Needs-Triage
No-Recent-Activity
Priority-0
Priority-1
Priority-2
Priority-3
Product-Cmd.exe
Product-Colortool
Product-Colortool
Product-Colortool
Product-Conhost
Product-Conpty
Product-Meta
Product-Powershell
Product-Terminal
Product-WSL
pull-request
Resolution-Answered
Resolution-By-Design
Resolution-Duplicate
Resolution-External
Resolution-Fix-Available
Resolution-Fix-Committed
Resolution-No-Repro
Resolution-Won't-Fix
Severity-Blocking
Severity-Crash
Severity-DataLoss
spam
this-will-be-a-breaking-change
Tracking-External
WindowsTerminal_Win32
Work-Item
zAskModeBug
zInbox-Bug
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/terminal#4405
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @edencorbin on GitHub (Oct 11, 2019).
Description of the new feature/enhancement
Have the option (or default) of a new terminal tab opening in the current directory of the window of which you hit the hotkey to open a new tab. This is the standard way most linux terminals work and is most handy. I often work in a directory where I need to launch multiple seperate processes, its a pain to CD back into the directory each time.
Proposed technical implementation details (optional)
Hit the new tab hotkey, the new terminal should then be in the same folder as the previouse.
maintainer edit: Before commenting, make sure to check out
Tutorial: Opening a tab or pane in the same directory in Windows Terminal
This is largely something configurable today, this issue is just tracking another way of configuring this
@egmontkob commented on GitHub (Oct 11, 2019):
There's a "standard" escape sequence (OSC 7 ; URI ST) to set the terminal emulator's belief about the current directory. It originates from macOS Terminal.app, and was later adopted by some other ones, including GNOME Terminal and as far as I know Konsole too.
Another possible approach is to do some OS-specific hacks to examine the inner state of the child process (or even further down to descendents).
Yet another possibility is to mix the two, e.g. go to the directory set via OSC 7 if it was ever emitted, otherwise dig into the process.
The advantage of the OSC 7 approach is that it's clever regarding when to and when not to follow a child process. E.g. you start another nested subshell, it'll be the subdirectory of that subshell that's taken into account because that one also emits this sequence. However, launch an app that internally changes directory (e.g. make) and it – luckily – won't be make's internal subdir that's used.
The disadvantage of OSC 7 is that it requires cooperation from the shell, or other apps that matter.
@DHowett-MSFT commented on GitHub (Oct 14, 2019):
I've been rejecting this feature request for as long as this project has been open-source, and I never learned about OSC 7. This is very exciting.
I'm not happy to crawl through the process tree to dig up the leafmost process's CWD, but I am extremely happy to support OSC 7.
@davidhewitt commented on GitHub (Nov 15, 2019):
FYI I asked about OSC 7 handling for Alacritty, which eventually led to this issue being created in the "Terminal WG" on gitlab: https://gitlab.freedesktop.org/terminal-wg/specifications/issues/20
There's not been much movement on that ticket, but you may be interested to follow it. Especially if you guys have any opinions regarding what a "formal" specification for OSC 7 might look like.
@zadjii-msft commented on GitHub (Nov 15, 2019):
So for the record, the thread at https://github.com/jwilm/alacritty/pull/2937 has a pretty great discussion.
Honestly, I'm pretty okay using the de-facto standard that's already in place, the
OSC 7 ; <URI> STmechanism. I'm not really sure there needs to be anything more formal than that.Wait no I had a terrible thought. Say
bashis configured to emit that, and someone runsbashin WSL. What are we supposed to do when someone tries to set the working directory to/home/zadjii? How we:Do we need to add some property on our side that indicates "this is a WSL distro, not a Windows exe"? What happens to users who don't set that, does the duplicate tab functionality just not work (effectively silently)?
Then the next part gets harder. What happens when this command is output over SSH? The terminal can't know that the path isn't on this machine anymore, right? How does Terminal.app handle this?
Maybe this does need more specification 😨
@egmontkob commented on GitHub (Nov 15, 2019):
(Off: How long is it going to be until I mix up the two of you, D Howett and D Hewitt? :))
@slikts commented on GitHub (Dec 10, 2019):
This is a crucial missing feature.
@anthonyvdotbe commented on GitHub (Jan 22, 2020):
This should be a config option for the different commands. For example, I'd like this for
duplicateTabandsplitPane, but not fornewTab.@LuanVSO commented on GitHub (Jan 26, 2020):
the escape sequence is documented in mac os terminal.app preferences as shown by this comment alacritty/alacritty#2937(comment)
@zadjii-msft commented on GitHub (Jan 27, 2020):
For the record, there's heated debate over in https://gitlab.freedesktop.org/terminal-wg/specifications/merge_requests/7 about the specification of exactly this feature. I doubt that we'll support any subset of this feature until there's an actually accepted proposal there - we'd rather not introduce another disparate implementation until there's an actual standard.
@egmontkob commented on GitHub (Jan 27, 2020):
I'd recommend you to do the opposite :)
Quite a few terminals have successfully implemented OSC 7, copying from each other, resulting in happy users.
And there is somebody out there currently who thinks it isn't good enough, he thinks a formal specification is needed; comes up with a draft that is full of problems, and what I cannot understand at all, is only willing to document one of two siblings. (Note: I stopped following that thread a couple of days ago.)
Terminal-WG is not a formal authority, its documents aren't "official", aren't "standards" in any de jure way. It doesn't even have proper procedures, people with responsibilities, voting rights, whatever; no one knows what it takes to get a document "accepted" there, whatever this status means at all. It's just a collection of random unorganized folks trying to come up with something useful. Don't let those unofficial pending debates stop you from implementing a long-proven feature.
@LuanVSO commented on GitHub (Jan 28, 2020):
i commented it on the issue referenced in that pr too 😉
@danpaolella commented on GitHub (Apr 19, 2020):
For anybody using Bash (from Git for Windows), a temporary workaround which has been saving me, is to store the new path every time you change dir (aliasing the
cdcommand), then cd there when a new shell is started; this is in my .bashrc:I'm actually testing if I start in System32 (my terminal default start location), so that I can still type
wtin the Explorer address bar and start somewhere else, but this bit is optional and should be customized if your shell starts in a different folder.I'm not fluent enough with the PowerShell or other shells, but I guess you can do something alike.
@tluanga34 commented on GitHub (May 14, 2020):
Ctrl+T should open a new tab with the same shell and the same directory.
@DHowett-MSFT commented on GitHub (May 14, 2020):
Not everybody agrees with that assertion.
@tluanga34 commented on GitHub (May 14, 2020):
Maybe many aggree. That's how terminal app works on most Linux desktop.
Atleast it can be made as an option.
@uranusjr commented on GitHub (May 14, 2020):
Hi, I believe it is already clear in this thread that many agree this is a useful feature, and the Windows Terminal team is also ware of this. And it is also clear that the problem here is not they don’t want to make this configurable, but they need to first figure out some technical stuff that prevents the feature from being possible.
I follow this thread to keep up to date on this feature and related discussions, but the messages like this only clutter the interface and do not help. I want to ask people to please refrain from posting messages that do little other than reiterating points that are already known.
@PandaClone commented on GitHub (May 14, 2020):
This is what I don't get about the stubbornness. If you want to go against how most terminals behave, cool. Not even giving an option though? Where's the logic in that? Even Ctrl+Shit+D that represents duplicating a tab doesn't actually duplicate it as it sticks you in the default directory. Like you have a duplicate feature that doesn't even duplicate.
What's the "technical stuff" that prevents this feature from being possible? The code already exists. There's already a duplicate tab in Ctrl+Shift+D. It just needs to be fed the current working directory and you have the behaviour that most people are used to and that people are requesting. So I'm confused at how this has "technical stuff" blocking it.
I appreciate this type of discussion because it's quite clear that there is stubbornness involved which means this type of discussion is necessary.
@zadjii-msft commented on GitHub (May 14, 2020):
Ah you're right, the original discussion is lost, because it didn't ever get linked to this thread. I'm copying the content of another post (https://github.com/microsoft/terminal/issues/2427#issuecomment-521307534) here for reference:
https://github.com/microsoft/terminal/issues/1756#issuecomment-520048598
https://github.com/microsoft/terminal/issues/2315#issuecomment-519317472
https://github.com/microsoft/terminal/issues/1536#issuecomment-519107586
Even if Powershell did set the working directory, we're still not positive that it's technically possible on Windows to get the CWD of another process. So that's the "technical" stuff that's preventing this from working. I'd love to add this as a setting. But there are definitely still technical questions that need answering.
The solution that's being discussed in this thread involves adding support for another VT sequence to the Terminal, that the shell would be able to emit to clue the Terminal in to what path it's in. This VT sequence isn't super well defined, and has edge cases that still need solving. Namely:
/home/foo? There's no way for the Terminal to know that path is a WSL path, or even which distro it belongs to, so duplicating this tab would likely end up inC:\home\foo(if it exists)@PandaClone commented on GitHub (May 14, 2020):
You're trying to duplicate the running processes? Let's look at Linux for example. If you're running SSH in your terminal and open a new tab, the new tab doesn't open an SSH connection and browse to where you are in the SSH connection. It opens up a new tab where you are on your machine. Even if the process was local and not SSH it doesn't run the process. All that's being duplicated is the tab, not the running processes.
It sounds like this is being overly complicated. You aren't duplicating VIM or SSH or any other application that's running. You're duplicating the terminal and that answers the edge cases:
There's nothing wrong with duplicating the processes. I'm sure some would love that. It's just that would be another option on top of the option to duplicate the tabs. It shouldn't be a road-block. That's extra and optional.
@DHowett-MSFT commented on GitHub (May 14, 2020):
@PandaClone it might surprise you to learn that some people set ssh.exe as the first thing that a profile launches, without running it from a shell.
Like as not, there really isn’t a way for the Terminal to interrogate
wsl.exe, the wrapper application that communicates with Linux processes, to get it to say what the current working directory is of the first process in its process tree.Because it doesn’t use the windows working directory infrastructure, which stores the WD in the process environment block, just using the boring old Windows APIs is not sufficient to tell what its working directory is.
These are technical problems that we have to solve. Otherwise, we write a feature that only works for, like, 25% of people.
If it proves to be easy: we are always willing to accept community contributions.
@zadjii-msft commented on GitHub (May 14, 2020):
Ah but see, the way this feature works as spec'd, the Terminal doesn't know who or what said "The current working directory is
/home/foo". This could becmd.exe- then yea, the user wantsC:\home\foo. This could be their Ubuntu distro, or their Fedora distro, or this could be ssh connected to centos or any other possibility. All the terminal gets is a string saying "this is the working directory now".Pretty much every shell the user runs is going to need to manually be configured to enable sending this sequence. For
cmdusers, they'll need to manually configure their %PROMPT% to include the sequence$e]7;$P$e.bashusers will need to set it up in theirPS1. PowerShell will certainly have another way to do it. The fundamental issue here though is that the shells don't emit this sequence by default.@PandaClone commented on GitHub (May 14, 2020):
SSH isn't a shell. You can set your profile to run it first, but it's still being run from the shell. It's just your profile is being instructed to run an application immediately. That application can be anything. It doesn't have to SSH. You can instruct your profile to run another shell if you wanted to.
And even in the case that there is no terminal, how is that a problem? There are always exceptions. Defaulting to the home directory when there is no directory to go to is fine. That's not a problem where you just "oh this can't be done".
Also, this is a feature that's standard in the majority terminals with tabs. Run any Linux distro which has their own terminal flavours and they all exhibit this behaviour of opening a new tab. This isn't a feature that's going to be ground breaking magic for Windows Terminal. It's a standard feature.
@DHowett-MSFT commented on GitHub (May 14, 2020):
Terminal doesn’t just spawn shells. It literally calls
CreateProcesson the thing you provide in the profile config. SSH isn’t running in, or spawned by, a shell.Look, we’re arguing about how possible this feature is. Can we just agree that we want this, everyone wants it, and if we had a reasonable way forward that worked in the vast majority of the use cases users care about that we would have done it already? I’m trying to reduce the number of times we have to say “on that can’t be done” with some upfront planning and design work.
It’s not groundbreaking magic, it’s just complicated by the Windows and WSL process model and we think it’ll fall over in some circumstances. Nobody’s saying anything more than that.
@PandaClone commented on GitHub (May 14, 2020):
How doesn't it know who or what said the current working directory is? You're the one asking for it. You know whether it's a Command Prompt or a WSL or a PowerShell. You know where it's coming from so you know how to format the location.
How is that a problem? This wouldn't be the first application to require configuration and it won't be the last. Not everything is plug and play and that's understandable. If the only way to make this work is for the user to require a configuration, how is that stopping point?
@liamness commented on GitHub (May 14, 2020):
I can only really speak for myself, but if I had a tab open using one profile, navigated somewhere specific, and then opened a new tab in a different profile, it would not surprise or disappoint me in the slightest if the working dir did not carry over, and the default was used instead.
I think you understand that most people asking for this feature are missing the behaviour in terminals such as those included with GNOME and macOS. Those terminals don't have to deal with the same complexities that this does, but at the same time, I don't think anyone is expecting you to try and smartly handle edge cases that simply don't exist in the software they're using as a reference point.
It sounds like a pretty hairy task even if you reduce the scope somewhat though. I hope a way can be found to include some version of this feature, as it is a nice time saver.
@dallonf commented on GitHub (Jun 15, 2020):
Could this use case be handled by #4472 in the short term? I'd personally be content with some variant of
cmd.exe /c "wt.exe" new-tab -p "Ubuntu-20.04" -d $(pwd)(probably bound to a Bash macro) that would open up a new tab in the most recently focused window (which is almost certainly the window that I typed the command in).@DHowett commented on GitHub (Jun 15, 2020):
Gonna go out on a limb and say that implementing detection for the root process's current directory is easier than implementing commandline remoting and IPC to get WT to open tabs in the same window 😄
@arbaieffendi commented on GitHub (Jun 21, 2020):
wow, i just came here and realize that it seems need a long journey :)
@arbaieffendi commented on GitHub (Jun 22, 2020):
We found that in windows terminal we could split the shell windows by press shortcut alt+shift+D, but it doesn't set to same directory
@LuanVSO commented on GitHub (Jun 29, 2020):
https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/7#note_552774
@IlliaBalia commented on GitHub (Jul 7, 2020):
I've come with a workaround: change the starting directory.
Put this function into
$PROFILE(make sure to adjust$path).. and you'll be able to a open new tab in the same directory almost with no hassle, just make sure to type
sdbefore opening a new tab.Of course, the drawback is that
startingDirectoryis changed every time the function is called.It would be best to use this approach with a key re-mapper, so that when
Ctrl+Tis pressed the function is called automatically, and whenCtrl+F4is pressedstartingDirectoryis reverted back to its original value.@FrederickEngelhardt commented on GitHub (Sep 8, 2020):
Alternative solution
Inside whatever profile you are using example profile.sh or .zshrc create a ~/paths.sh file located within your $HOME directory. Paths will be updated whenever you call setCWD
This solution overrides the startingDirectory completely. Whenever you spawn a new terminal call setCWD before spawning the terminal and it will always start in the directly you last called setCWD in.
Note that I did this within
.zshrcCode:
You may need to create an initial file so just call setCWD.
BTW if you are using autohotkey, here's a nice and quick script to get things working
Make a file called
windows-terminal.ahkand then paste this code below. Run the file and you are all set. (I recommend moving this file into the startup section so that when you restart this functionality is re-applied.@osiris-plus commented on GitHub (Sep 12, 2020):
Guys, this is very important for productivity, almost like it's above everything else. Please fix this, me and my friends will happily abandon all of the other inferior terminal emulators.
@TBBle commented on GitHub (Sep 13, 2020):
It looks like the attempt to 'standardise' OSC 7 at terminal-wg has stalled.
Is there still interest in implementing OSC 7 basically as it stands in Terminal.app?
Given that, we'd have "current host and CWD" for a given terminal, which just blats the 'process hacking' discussion; and then can decide/implement the user behaviours to make use of that information, e.g.,:
This discussion was very focused on the first part (getting the current CWD) but I suspect the second part is the one that will need more consideration, based on the existing comments so far above. Even for that list of ideas, I'm sure a reasonable objection exists to every one of them.
@skyline75489 commented on GitHub (Sep 18, 2020):
For those who are still intersted in this topic, I made a early PR in #7668 . This is a a friendly ping. I'd really love to hear from everyone about it.
@pml4 commented on GitHub (Oct 8, 2020):
What is the point of multiple tabs, especially fast duplication, if they don't inherit the current directory? This is such an important feature. Why not add a "hacky" workaround for now? I really don't see a problem extracting CWD from a process on Windows if it increases productivity for all the users, considering Windows itself has contained multiple such solutions for more than 20 years.
@dlmoffett commented on GitHub (Nov 13, 2020):
I can't understand why this feature isn't the default. I truly am boggled as to why there isn't even a way to enable this feature. This is the biggest user experience detractor I have with Terminal: from an expedience perspective I am better served by not using Terminal and instead using explorer and right clicking in the directory I want to open the shell and selecting "Open PowerShell window here" because it's faster than hitting
alt+shift+dthen having tocdto the right place.Terminal adds a lot of quality of life for Windows devs. This feature would be huge jump forward for me (and I suspect others). I'll add my voice in advocating for this feature be a top priority.
@zadjii-msft commented on GitHub (Nov 13, 2020):
I can't understand why people can't be bothered to read all the investigation that's been done in this thread, in #7668, #8214, #8166, and the other linked threads, to understand why this is actually a hard problem to solve. It turns out you can't just have a client app emit it's path - because the Terminal won't necessarily know whether that's a Windows or a WSL or a cygwin path.
It's a good thing we've got a bunch of talented contributors who are hard at work finding out the right way of implementing support for this feature, without breaking backwards-compatibility for other apps. We've just this week come up with a solution we're happy with, shouldn't be long before it's implemented.
@dlmoffett commented on GitHub (Nov 13, 2020):
Thanks @zadjii-msft !
In rereading my comment I'm realizing it comes off super accusatory and that was not my intent. I came here to say this:
And that my user experience so far has been this:
I probably should have put "as a user," at the beginning of my first paragraph.
I apologize for any offense I've given.
@hiepxanh commented on GitHub (Jan 13, 2021):
Happy new year :D I hope this feature so so much
@azterizm commented on GitHub (Jan 19, 2021):
I've found a very simple solution to this. What you need to do is execute a function on every cd command and save that somewhere so that it can be read on new instance.
To achieve this, you will modify your shell config file. I am using Fish shell on my machine (that uses ruby-like syntax), but you may convert this syntax to make it work for others. (tested on Zsh)
Add following to the
/root/.config/fish/config.fishor your shell's equivalent.⭐As a bonus, if I shutdown/restart my PC and open terminal again I automatically cd into my last project directory. Cool! 😎
@kpost commented on GitHub (Jan 20, 2021):
Nice, thanks!
The shell script version if this:
@vdsbenoit commented on GitHub (Jan 20, 2021):
I've tried a similar solution to @azterizm's one in the past. Always opening a terminal in the previous
cdlocation can be inconvenient in some situations :@azterizm commented on GitHub (Jan 20, 2021):
About the option in the context menu "Open a terminal here", we can make a script for this.
A script that takes the directory of where the context menu was called from, then we convert the slashes to what Linux uses (
C:\to/mnt/c) then run the Linux command from Powershell that updates~/.last_dir. Finally in the same script, open the terminal normally. It will be exactly what you want.The command that will update the file should be
wsl /mnt/c >> ~/.last_dirCurrently, I do not know how to make scripts for Powershell but surely someone should try that.
As for the IDE's or other embedded tools, we might need to add a script to them that clears
~/.last_dirfile on opening the terminal in there.@TBBle commented on GitHub (Jan 20, 2021):
#8330 implemented the infrastructure needed for this, it should be part of the next Terminal
1.51.6 preview release.You'll need your shell to generate the
OSC 9;9messages, and once that's working, you will get this behaviour for duplicating tabs and splitting panes when that release happens.This is compatible with ConEmu, so ConEmu's OSC 9;9 "How to set it up" instructions should roughly work, where they use ANSI codes rather than
ConEmuC; the "WSL/cygwin/msys" instructions need to be adjusted as they generate Unix paths, and for Windows Terminal you need Windows paths.These instructions also do a bunch more, the part you need is the part that generates the
9;9message, I am unaware of Windows Terminal consuming the9;12message, but of course it wouldn't hurt.e.g. for PowerShell, the given example can be trimmed to this for the minimal change:
Note: I haven't tested this myself, but I wanted to make sure people knew this feature desire wasn't being ignored.
@skyline75489 commented on GitHub (Jan 21, 2021):
The author of #8330 here. I can confirm it in fact works with the current dev branch. It should be available in 1.6 preview.
@songyongshun commented on GitHub (Jan 28, 2021):
for bash, $argv should be $1
@bardware commented on GitHub (Jan 29, 2021):
In a
cmdenvironment I callstartto open a new console. Can Terminal not capture a call tostartand open a new tab instead?@LuanVSO commented on GitHub (Jan 29, 2021):
no that would require #492
run this on cmd to make ctrl+shift+d keep the current dir (will have to restart the current cmd for it to take effect)
@saschanaz commented on GitHub (Jan 30, 2021):
Is OSC 9;9 something that can be natively supported by shells? Should I file an issue in PowerShell repo?
@LuanVSO commented on GitHub (Jan 30, 2021):
@saschanaz probably, you will get a better shot on psreadline repo.
but it's pretty easy to DIY, just put this in your
$profile@TBBle commented on GitHub (Jan 30, 2021):
So now that this is working for duplicate tab and split pane w/duplicate, I'd like it for "new tab", as per the original request. Probably as a parameter for the
newTabaction, not a change in the default. My use-case is that sometimes I'm in a directory in PowerShell, and I want "Git Bash here".Should I open a new issue for that request, or is that in-scope for this one as further work after #8330?
I also noticed that the default keybindings for splitPane (
alt+shift+-andalt+shift+plus) do not get this behaviour, because they are using the default splitMode, 'Manual', which launches the default shell due to lack of other parameters. I guess it might be surprising for users that a 'Manual' splitPane that picks the same profile as my current terminal, is different from a 'Duplicate' splitPane. It certainly surprised me. ^_^(Side-note: Should the default
splitPanekeybinding be Duplicate rather than Manual? I guess Manual is consistent with the defaultnewTabkeybinding... Now I know this, I'm locally overriding thosesplitPanedefault keys to be Duplicate)It's possible that for what I want, a magic token for the
startingDirectoryparameter of thesplitPaneandnewTabactions would be sufficient, but personally I'd lean towards a boolean field forcopyWorkingDirectory, except that this might incorrectly set the expectation that it "just works" without the current shell calling OSC 9;9 (or OSC 7 etc. in future).A magic token could be explicitly tied to "the directory set by OSC 9;9 or OSC 7, see the WT OSC docs for details".
@ojroques commented on GitHub (Jan 31, 2021):
It wasn't clear to me how to enable
OSC 9;9for WSL but I've finally figured it out. You should put this line in your .bashrc:@TBBle commented on GitHub (Jan 31, 2021):
If anyone is using PowerLine, this is what I'm using in the
Promptarray of${ENV:AppData}\powershell\HuddledMasses.org\PowerLine\Configuration.psd1to generate OSC 9;9, as well as output the current directory:I've added the last two escape sequences as well:
Each of those lines has the same character at the start. I just copied the 'Esc' line (really should be "CSI", I think), changed the non-hidden character, and the name.
My whole Configuration.psd1 file for context
Originally generated with
Export-PowerLinePromptand then modified as the mood hit me.@s-celles commented on GitHub (Feb 6, 2021):
As suggested in #9063, here is an other UI proposition for such a feature.
Proposed technical implementation details (optional)
Right click on a tab could have a "New" contextual menu (between rename tab and close) which could show same entries as those in the "+" tab.
The main difference would be that a new tab will be created with the "context" of a tab which was opened previously (context being here the current working directory)
@paulvandenburg commented on GitHub (Feb 24, 2021):
If you tried this and it didn't work, it could be that you're running the stable version of terminal which doesn't have this yet.
You can get the preview version from the store: https://www.microsoft.com/store/productId/9N8G5RFZ9XK3
Just confirmed it working for WSL 😃
@gemboj commented on GitHub (Feb 25, 2021):
I have a very strange issue with this solution. I've installed Ubuntu 20.04, put the export into my
.bashrcand as expected, it started working. I've then played around, installed some additional packages into my ubuntu and reinstalled whole distro Ubuntu 20.04 from microsoft store a few times, to reset clean my wsl.At some point, I've noticed that this trick stopped working. No matter what I do, the windows terminal no longer has the ability to properly set the directory for a new tab to match the existing tab. I've tried everything that came to my mind: reinstalling windows terminal, reinstaling all the linux distributions, installing additional distributions (Ubuntu 18.04, openSUSE Leap 15.2), reinstalling linux kernel update package, disabling and reenabling the wsl from windows features, and updating my Windows version. Nothing works.
I've no idea how to debug the issue. Is this some wsl problem? Windows terminal problem? How to make sure that everything is properly cleaned up before reinstalling everything?
Operating System info
Additional info
@LuanVSO commented on GitHub (Feb 26, 2021):
put
in the global settings for windows terminal

then hold down both alt keys and open the profile that you are having problems, should look something like this:
verify if osc9;9 is being emitted
@mnpenner commented on GitHub (Feb 26, 2021):
Anyone happen to know how to add OSC 9;9 to Powerlevel10K (zsh)? I don't think
export PROMPT_COMMAND=works.@LuanVSO commented on GitHub (Feb 26, 2021):
here:
put it in a file and then source it from .zshrc or .bashrc
@gemboj commented on GitHub (Feb 26, 2021):
After turning on the

debugFeaturesI got the following result:The
9;9;//wsl$/Ubuntu-20.04/home/gembojbefore my prompt (which is not visible in the non debugging terminal) tells me that the osc9;9 is properly emitted. Still, the directory of a new tab is not set properly.@zadjii-msft commented on GitHub (Feb 26, 2021):
@gemboj Just to be sure, you're using a
duplicateTabaction/keybinding to attempt to duplicate the tab, right?@gemboj commented on GitHub (Feb 27, 2021):
Okay. This is the moment I want to curl up and die. At some point my muscle memory must have kicked in and I started using ctrl+shift+t (new tab) instead of duplicating the current tab. At least I've learned the neat trick with
debugFeatures. Now to never come back here out of embarrassment...@catweazle9 commented on GitHub (Feb 28, 2021):
Putting the above in my .zshrc meant the function was re-added each time I sourced .zshrc, and I think I noticed a slowdown in showing the prompt that worsens for each occurrence. To limit this to one instance I tweaked it slightly to this:
@omar-toma commented on GitHub (Mar 2, 2021):
I confirm that @ojroques's solution works for me on wsl
If you are using fish shell like me, I managed to make make it work by adding a new file in
~/.config/fish/conf.dfor ex.windows-terminal.fishand added this to it@robsonsobral commented on GitHub (Mar 2, 2021):
I just added this to my $profile without luck:
Running the new v1.6.10571.0 on Windows 10
@LuanVSO commented on GitHub (Mar 2, 2021):
@robsonsobral here:
https://gist.github.com/LuanVSO/6f2b94cf3bd90f184722676c43ccc1c6
@robsonsobral commented on GitHub (Mar 3, 2021):
Thank you, @LuanVSO ! It worked!
I also had to move PSHAZZ script to the top of the file.Actually, pshazz block the script to run. It has to be removed.@TBBle commented on GitHub (Mar 3, 2021):
A brief look at pshazz's prompt management suggests that you could write a plugin something like the z plugin to act on each prompt-display and call the
Write-Hostyou want (i.e. the first three lines of thepromptfunction from @LuanVSO), although you have to activate the plugin in your preferred theme, I assume.Otherwise, perhaps modify
global:pshazz_write_prompt, to callWrite-Hostwith the relevant values irrespective of theme.@robsonsobral commented on GitHub (Mar 3, 2021):
Thank you, @TBBle ! It worked!
I already wrote a plugin to customize things. So I added:
Thank you so much!
@Evineit commented on GitHub (Mar 14, 2021):
I was having trouble getting to work the new duplicate tab in the same directory, after adding the code to my PowerShell profile now it seems to be working fine and the OSC9;9 is added, i don't know why this was happening. I added both images of the debug terminal before and after adding the function.
Before

After

Thank you, @LuanVSO!
@LuanVSO commented on GitHub (Mar 14, 2021):
that's because PowerShell by default does not emit the required escape esquece for it to work
@merrijo commented on GitHub (Mar 19, 2021):
Has anyone gotten OSC9;9 to work with Windows CMD? I tried the
setxexample above, but it didn't work...I also noticed some weird behavior in Powershell 7.1, but I don't know if this is the best place to ask. When I pipe a command I start seeing OSC9;9 outputs, for example:
Has anyone else seen this behavior?
@LuanVSO commented on GitHub (Mar 19, 2021):
that's because the git for windows commands explicitly disables vt processing and powershell doesn't turn it back on when native commands exit, this was resolved in the latest powershell 7.2 preview
@LuanVSO commented on GitHub (Mar 19, 2021):
https://gist.github.com/LuanVSO/09ba0239fe7c1a959a9b07c7156c5e13
@patricknelson commented on GitHub (Mar 19, 2021):
For anyone looking for a workaround that is nearly as good (but not exactly the same), there is an alternative approach. Instead of maintaining the current working directory, you can at least ensure that new tabs and panes open in the same starting directory (since current will vary over time).
Alternative steps:
Use the custom right-click integration by BroJenuel/Explorer-Context-Menu-Integration-for-windows-terminal (which isn't subject to the separate but related bug documented in #8933).
Since that creates a duplicate right-click entry, remove it by using the fix documented here: https://github.com/microsoft/terminal/issues/7008#issuecomment-662621638, or drop this into a
.regfile and run it:End result is that it will at least persist the same starting directory (albeit it will not be up-to-date with
cdchanges, which is really what this issue is about).Demo:
@merrijo commented on GitHub (Mar 19, 2021):
Thanks for this, however it doesn't work for me. The split panes always open in my default user path.
Aha, thanks for clarifying! I'll test the latest Powershell 7.2 preview.
@skyline75489 commented on GitHub (Mar 19, 2021):
@joshmer Remember to use "duplicate pane" instead of "new pane". Only by duplicating a pane, you'll have the same CWD in the new pane.
@merrijo commented on GitHub (Mar 19, 2021):
Duplicate pane is alt+shift+d correct? That's what I'm using. Here's a snippet from my settings file to confirm:

@skyline75489 commented on GitHub (Mar 19, 2021):
@joshmer Yes. Seems like you're doing the right thing. The
setxthing works for me in plain CMD. But it doesn't work for like VS Developer Command Prompt for some reason. Are you also trying to make it work for Developer Command Prompt or something?@LuanVSO commented on GitHub (Mar 19, 2021):
@joshmer could you also try this steps please
@merrijo commented on GitHub (Mar 19, 2021):
Nope, I'm using standard CMD via Windows Terminal.
Edit: Apologies, I wasn't holding both ALT keys!
I also have clink and MSYS2 setup in my system, so maybe something there is messing with things?
@skyline75489 commented on GitHub (Mar 19, 2021):
OK I see
clink.batand related things in it. Guess that's the cause, since it's working fine in plain CMD. Perhaps this is the same reason why VS Developer Command Prompt doesn't work.Unfortunately I'm no expert at CMD. I hope someone could shed light on this topic.
@DHowett commented on GitHub (Mar 19, 2021):
Is there a chance vsdevcmd just ... overrides the directory on startup?
@DHowett commented on GitHub (Mar 19, 2021):
Actually, yeah, the only OSC I'm seeing in that trace is OSC 0 (set title). There's something stripping it out before it gets printed.
@merrijo commented on GitHub (Mar 19, 2021):
Ok, so I tried to rename all vsdevcmd.bat files to prevent them from doing anything, and it didn't work. Then I uninstalled clink and I'm now getting the correct OSC prompts! I reverted the vsdevcmd file names and it's still working fine.
As a sanity check I reinstalled clink and OSC is broken again, so I'll have to do some digging into what's happening there. Thanks all for the help!
@TBBle commented on GitHub (Mar 19, 2021):
I was just poking around in the Clink source, and it seems like it should be passing OSC codes through but it definitely has code to parse then, e.g., 0.4.9, 1.0.0a1, and I suspect that it's locally handling them to generate Console API calls, and hence stripping them even if it doesn't handle them.
So possibly (although I couldn't find this code in 0.4.9 as GitHub has indexed after a refactoring) it's only passing through recognised codes, and OSC 9;9 isn't recognised yet.
Either way, sounds like a bug report for clink is in-order here.
@piradata commented on GitHub (Mar 21, 2021):
TL;DR
For the ones reading this right now that wants this behaviour on windows terminal WSL, just add the following line on your ~/.bashrc file:
export PROMPT_COMMAND='printf "\e]9;9;%s\e\\" "$(wslpath -m "$PWD")"'Then the terminal will maintain the path when you press "Alt+Shift+D", but when you split with "Alt+Shift+-" or "Alt+Shift+=" it will open with the standard path, and that is pretty ok in my opinion. To configure the standard path to be your wsl home directory, edit your setting of WSL profile to be something like this:
{ "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "startingDirectory": "\\\\wsl$\\Ubuntu\\home\\<Your_User>", "hidden": false }Cheers!!
@JCMais commented on GitHub (Mar 21, 2021):
Is it currently possible to pass split mode to the
wtCLI?@DHowett commented on GitHub (Mar 21, 2021):
Yes.
@zadjii-msft commented on GitHub (Mar 22, 2021):
Actually that might not be right - you can pass the split direction but the
splitModeis alwaysmanual@JCMais commented on GitHub (Mar 22, 2021):
@zadjii-msft do you want me to open a new issue with that feature request or that is not needed? 😄
@zadjii-msft commented on GitHub (Mar 22, 2021):
Nope, I already filed one 😉
@tignioj commented on GitHub (Apr 12, 2021):
Thanks for you, I have made some changes to the code to accommodate those with commas after them, It work's for me!
@ropbastos commented on GitHub (Apr 13, 2021):
Many thanks for that, been wanting that feature for ages!
Unfortunately, it seems to break Chocolatey/Scoop. After installing programs with them the PATH seems to not be edited anymore. I just pasted that on my $profile, am I missing something?
@LuanVSO commented on GitHub (Apr 13, 2021):
@ropbastos do you mean that the
refreshenvdoesn't work anymore?could you share the contents of your
$profileplease?@ropbastos commented on GitHub (Apr 14, 2021):
My bad, I don't really know what went on when I made that comment. I remember running "choco install nodejs" and not having node show on path but I just tried to reproduce it and, happily, I guess x), failed. It works perfectly it seems, sorry! And many thanks to all contributors here!
@tg21 commented on GitHub (May 5, 2021):
I am able to replicate Panes and tabs(with same working directory) in windows terminal using these steps.
obtained terminal context menu item using this library Windows-terminal-context-menu. For some reason it does not work with default context menu option

set Starting directory of all profiles to "use parent process directory"

this is my key-mapping for split-pane
{ "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": [ "alt+shift+d" ] },Result

This works for tabs as well.
I hope this helps.
maybe devs can see how differently this library is making context menu options.
let me know if you need some more details.\
Known issues with this workaround
@TBBle commented on GitHub (May 5, 2021):
That approach is no different to just going into the directory in a console, and running Terminal from there.
It doesn't help this ticket at all, which is for this:
It won't interfere with it though, so if you then add "OSC9;9" to your various shells, then 'duplicate' and 'split-Duplicate' will work, but 'New tab' and 'split-new' are still to be done.
That said, that's a clever shell extension idea that solves a different, related problem.
@tg21 commented on GitHub (May 5, 2021):
Yes you are absolutely correct.
while mentioning known issues in my workaround I realized this wasn't exactly what this thread was about.
But because almost all issues mentioning duplicate tabs/panes with same directory are marked duplicate of #3158 and closed. I thought I would leave it here for some like me willing to make do with this solution in the meantime.
@Trance-Paradox commented on GitHub (Jun 15, 2021):
I want to open new terminal tab of other command lines in the same directory. For example I have a currently active tab of powershell in a specific folder. Not I want to open cmd in the same folder seperated from the current tab.
@skyline75489 commented on GitHub (Jun 15, 2021):
@Trance-Paradox I think what you looking for is #10232
@Trance-Paradox commented on GitHub (Jun 16, 2021):
Yes thank you
@NicTanghe commented on GitHub (Jul 14, 2021):
Hello,
I wasn't sure this was specified already.
But I'd like to add this.
Any way to have a function to tell
wt -w -0 nt program.exeto also run from the current directory ?I don't want to write extra logic for saving the current directory in my rust program every time.
@zadjii-msft commented on GitHub (Jul 14, 2021):
@NicTanghe try
wt -w -0 nt -d . program.exe@NicTanghe commented on GitHub (Jul 14, 2021):
Thanks 4 the lightning fast helpfulness as always :D
I thought that would only work for opening new terminal tabs.
@touhou-ayaya commented on GitHub (Aug 27, 2021):
I add the following line on my ~/.bashrc file
cd $(cat $HOME/.my_current_path)alias pwd='pwd|tee $HOME/.my_current_path'when I run
pwdin terminal, the current path can be recorded in.my_current_path.now, you can openning in current path when you open a new tab or a new window.😂
@Decoherence commented on GitHub (Aug 27, 2021):
Inspired by @touhou-ayaya's comment above, here's a way to open tabs in the current directory automatically (without running
pwdeach time).I appended this to bottom of my
~/.zshrcfile (it should also work with~/.bashrc):This basically overrides the standard
cdcommand so that whenever you change directories, the new path is written to$HOME/.my_current_path. Thebuiltinprefix is required to prevent the function from recursively calling itself forever.And the last line simply changes to that directory when opening a new tab.
I'm certainly no bash expert (is anyone, really? 😆), just wanted to share this quick solution in case someone finds it helpful.
@liamness commented on GitHub (Aug 27, 2021):
This issue should probably be closed, given that an officially supported solution exists in a stable release (unless I'm missing something).
There is support for the OSC 9;9 escape sequence, which when set up, allows you to duplicate a tab in the same directory with ctrl+d. Yet people are still discussing hacky workarounds. I think the issue still being open is potentially confusing people.
If you use bash, put this in your .bashrc:
If you use zsh, put this in your .zshrc:
I use zsh personally so I've only tested the latter, but they should both work.
@LuanVSO commented on GitHub (Aug 27, 2021):
it's not closed because osc7 is different from osc9;9
@liamness commented on GitHub (Aug 27, 2021):
The workarounds being discussed are also different from OSC 7. I never really got the impression that this issue was specifically about one particular escape sequence, but more about the functionality (opening a new tab in the same directory) regardless of how it is achieved.
Support for OSC 7 would be nice I suppose. Would be more aligned with other popular terminals like Terminal.app and GNOME Terminal. And AFAIK it wouldn't require this extra step to set up, although that may depend on which shell you happen to be using.
@TBBle commented on GitHub (Aug 27, 2021):
OSC 7 support got bogged down because there are a few different conflicting specifications for it, and the main thing they have in common is that they assume the Free Desktop specification for
file://URIs, and hence had unclear or unhelpful semantics when dealing with the Windows definition offile://URI handling, and which got worse when WSL got involved, because the Free Desktopfile://URI spec simply doesn't account for (predates?) filesystem namespaces and virtual filesystems when they share the same hostname as the physical/underlying filesystem, which is the case for pretty much anybashrunning on a Windows host, e.g. WSL, MSYS2, Cygwin.OSC 9;9 has the advantage that it's already defined as a Windows-native path, so the implementation was uncontroversial, and delivered the needed functionality (informing the terminal of the shell's CWD). It also has the advantage that it won't conflict with anyone's existing Linux-native OSC 7 support scripts, e.g. when using Gnome Terminal from within WSL, OSC 7 will need to have the in-WSL path, while Windows Terminal needs the translated Windows path.
Overall, I agree that this ticket could probably be closed. For a while, people were posting OSC 9;9 implementation scripts, which was nice, but they're starting to scroll out into the "hidden items", and this is probably the wrong place to document such things anyway. https://github.com/MicrosoftDocs/terminal/issues/285 would be the right place, I guess.
#10232 is tracking the next evolution of this feature: conditional integration with "New tab/pane" support.
@bravely commented on GitHub (Sep 21, 2021):
For anyone having difficulty, I put together a a quick guide on accomplishing this(as long as you're willing to use OSC 9;9), as reading through everything here and in the related threads was pretty confusing.
@Plasmadog commented on GitHub (Sep 29, 2021):
Umm, is it? I'm on 1.10.2383.0 and both split and duplicate still always open in my home folder. What build should I be using to get this behaviour? (I only care about Powershell tabs)
@TBBle commented on GitHub (Sep 30, 2021):
Have you set up our PowerShell to output
OSC 9;9data so that Windows Terminal knows the current working directory? Also, the defaultsplitcommand in the Windows Terminal key bindings is not 'duplicate', so you'll have to rebind that or it splits into a new copy of the profile, and won't look at the current working directory of the existing profile.@Plasmadog commented on GitHub (Sep 30, 2021):
Is that a documented process? I have no idea what it even means let alone how to do it, and if the position of the Windows Terminal team is that this commonly requested feature is a solved problem, then I would expect to see some reference to it in the official documentation.
@zadjii-msft commented on GitHub (Sep 30, 2021):
It's on the todo list, see https://github.com/MicrosoftDocs/terminal/issues/285. We'd be happy to accept contributions in this space, especially since folks have plenty of different ways of doing this for plenty of different shells already.
@nacitar commented on GitHub (Oct 1, 2021):
@Plasmadog
Perhaps you, like me, have previously fixed the silly default behavior that wsl has where it starts you in %USERPROFILE% instead of $HOME, and did something like:
"commandline": "wsl.exe ~ -d Ubuntu"in your settings.json, and it is thus overriding the default path and forcing to HOME. If you remove the ~ argument there, it will work, provided that this is indeed what you did.
EDIT: I'll leave this here for others, but the "powershell" bit means this isn't what he did.
@Inch4Tk commented on GitHub (Oct 1, 2021):
For anyone trying to get it to work with Cmder/Clink.
@s-celles commented on GitHub (Oct 21, 2021):
As mentionned in https://github.com/microsoft/terminal/issues/10232#issuecomment-948303453 I'm looking for an "out of the box" solution to have duplicated tabs in the same current directory then source tab.
@TBBle commented on GitHub (Oct 22, 2021):
Since there's no code work left to do here (https://github.com/MicrosoftDocs/terminal/issues/285 and #10232 exist for the remaining work), perhaps it's time to close this ticket?
Alternatively, perhaps one final improvement to bring us closer to "out-of-the-box" would be to make the default for the
splitPaneaction be "duplicate" instead of the currently-unnamed approach, if noprofileis provided. That would certainly remove the keybinding overrides I'm carrying, and I think be less-surprising for users who've set upOSC9;9in their shells.It's kind-of weird that
splitPanetakes both a profile and a duplicate flag separately, and the default behaviour is neither of them set, and I don't know which one wins if you set both.Perhaps that should be a new ticket though, but I don't feel strongly enough about it to create that ticket right now. ^_^ (I also don't use split very often, so am probably not the right person to make a use-case-based change proposal)
@zadjii-msft commented on GitHub (Oct 27, 2021):
I wouldn't totally agree with the assertion that there's no work to do here. IIRC, after the discussion we had in #8214, I think the plan was to do the following:
OSC9;9because we can be reasonably sure those are windows pathsOSC7. We'd need to know when a profile is a WSL profile, and when it is, we'd translateOSC7paths back to Windows paths (internally).#11625 does a lot of the work for the second point here. that plumbs through the profile source all the way through to the control. Now we'd need to also plumb through some sort of property with the distro name, so we can do the WSL -> Windows translation as well. Fortunately, we could silently upgrade the distro generators to include that property, so that they will add it by default for everyone.
@TBBle commented on GitHub (Oct 27, 2021):
Ah, fair nuff. I had 100% forgotten about that discussion (2020 wasn't real...), and that OSC 7 has a path forward.
That said, this ticket has accumulated a lot of stuff that either isn't super-relevant after that discussion and its resolution, or is OSC 9;9 specific (or is actually looking for the feature in the other tickets I linked in my earlier post). Since the core "profiles have a CWD" and the easy-to-unconditionally-enable "use the CWD when duplicating tabs" work is done, I would track things like "hook OSC 7 to set the profile CWD when we know it's WSL" as a separate ticket, because that's how I model it mentally.
But it's not my project, so track the work as is best for you and the team to deliver the goods. ^_^
@amzon-ex commented on GitHub (Nov 3, 2021):
Any updates on work (possibly) going on regarding this functionality and/or any available workarounds? There is a way to do it like
But, more elegant ways?
There are so many different topics discussed in this thread that I cannot figure out what to look for.
@maximosdrr commented on GitHub (Nov 7, 2021):
Thanks, it worked just fine for me <3
@robsonsobral commented on GitHub (Nov 11, 2021):
Weirdly, this stopped working for me.
@JelteF commented on GitHub (Nov 11, 2021):
@robsonsobral if you started using Windows 11, then you don't need
wslpathanymore if you're using WSL. The normal linux path is what you can provide in the printf now. So this should work:@robsonsobral commented on GitHub (Nov 11, 2021):
Thank you, @JelteF , but I'm not using WSL neither Windows 11.
@robsonsobral commented on GitHub (Nov 12, 2021):
I'm so dumb! I forgot I've installed Starship! Now, I need to find how to enable things again.
@TBBle commented on GitHub (Nov 12, 2021):
For Starship, what you need will be very similar to this recipe. There, they're passing the current directory (and possibly some other text) into OSC
0, so it's pretty close to what you already have, e.g., in the PowerShell recipe replacewith
If you're using bash from cygwin, MSYS2, or Git For Windows, then it'll be very similar to the WSL recipe give above, but use
cygpath -winstead ofwslpath -m, i.e. replacewith
And of course, if some awesome person wanted to teach Starship to emit this sequence (and maybe OSC 7 while you're there), that would be at least 20% cooler.
@shivjm commented on GitHub (Nov 12, 2021):
In case you’re using PowerShell, this is what works for me to both register the working directory and update the window title:
@robsonsobral commented on GitHub (Nov 12, 2021):
Thank you so much, @TBBle and @shivjm !
Couldn't we add all these recipes to docs?
@shivjm commented on GitHub (Nov 12, 2021):
I’d certainly love to see that! Note that the just-released Starship v1.0.0 supports a PowerShell pre-command. I adapted the example from the website:
@TBBle commented on GitHub (Nov 13, 2021):
The docs don't exist yet, there's a ticket at https://github.com/MicrosoftDocs/terminal/issues/285 to put something together, but it's not trivial, or at least no one's attempted it yet, AFAIK, due to the wide variety of shells, prompt automation scripts, and general system setups people use.
@shinebayar-g commented on GitHub (Dec 6, 2021):
Thanks to above users. This works on Windows 10/11 + Zsh.
@nova77 commented on GitHub (Dec 30, 2021):
Not sure what happened, but with Windows Terminal (Ubuntu + bash) 1.11.3471.0 the "OSC 9;9 escape" no longer seem to be working.
UPDATE: it seems to be an issue with oh-my-posh.
UPDATE2: this has been fixed in https://github.com/JanDeDobbeleer/oh-my-posh/pull/1516. If you suffer from the same problem, get the latest oh-my-posh binary (thanks Inu!)
@nacitar commented on GitHub (Jan 6, 2022):
Mine stopped working as well, and I wasn't sure what was amiss... but MANY examples use $(wslpath -m "$PWD") or equivalent, and indeed I had implemented this feature using that approach as well. If you look at the change made by oh-my-posh, it simply started using $PWD without "wslpath -m" processing it. Removing this from my own fixed the issue as well.
I don't know that I'd call this a bug in oh-my-posh, it WORKED previously with this approach, so there was some sort of behavioral change in windows terminal along the way too...
my own fix commit
@dotnetCarpenter commented on GitHub (Feb 9, 2022):
In case you missed it, there is a tutorial on how to open a new tab/split pane in the same directory at https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory
As far as I can tell, the fix does not involve OSC 7 but I am guessing that 90% of people here are more interested in opening a new terminal with the same directory, than the technical details. In that regard, I think this issue can be closed as solved.
I have followed the tutorial and it is working in my WSL2 Ubuntu setup.
@zadjii-msft commented on GitHub (Feb 9, 2022):
Meh, in my opinion, I'd like to keep it open. As I discussed, I do still want to make this sequence work as well.
THAT BEING SAID
Yea, basically everything you could want from OSC7 will work just as well with OSC9;9. The difference is absolutely technical nitpicking 😄
for the folks in the back
Go read this guide: Opening a tab/pane in the same directory in Windows Terminal
thanks to everyone in this thread who's recipes I was able to use to help write that ☺️
@nephewtom commented on GitHub (Feb 11, 2022):
Ok, I am a folk in the back...
I tried those solutions for CMD and WSL, and only the WSL one works for me.
I am following exactly the instructions steps for Command Prompt: cmd.exe :
This works:
set PROMPT=$e]9;9;$P$e\%PROMPT%But this one fails:
setx PROMPT %PROMPT%So, I quoted it:

But still not getting duplicated tabs on the same path, neither split panes (with splitMode duplicate) on the same path.
Am I forgetting something?
Best Regards.
@TBBle commented on GitHub (Feb 11, 2022):
I'm pretty sure
clinkis your problem here, as without it, both commands worked for me as per the instructions. Somewhere in the hidden comments of this ticket, there was a note that clink was interfering with the relevant ANSI codes, and I don't believe it was ever resolved.My guess would be that it's eating the ANSI codes, so the OSC command is never seen by Windows Terminal.
For the
setxissue, it's probably because a " " has ended up in your prompt env-var (I would guess that clink lives in your prompt already). So the instructions should be updated to quote the%PROMPT%as you have done. I was able to reproduce this problem by manually putting a space into my localPROMPTvar, so it's not a clink problem per-se, but I guess in your case,clinkis why the space is there, even though it's not visible in the displayed prompt.You could
echo %PROMPT%to confirm this.Ah, someone did get it working with clink in the end: https://github.com/microsoft/terminal/issues/3158#issuecomment-932529090. Looks like you need to do the config in clink's settings, as it's probably using the
PROMPTenv-var itself.Ah, yes. Per the docs
and
So yeah, clink is destructively (in our case) filtering the
PROMPTenv-var, but per the fix above, doesn't damage ANSI codes in the prompt when done in Lua.Edit: Note, those doc links turn out to be from a fork of Clink. The original version hasn't had a release since 2017, nor even a commit since 2018, so it may be that the forked version I got those docs from does work correctly (i.e. not mangle the ANSI codes) even if using
%PROMPT%rather than Lua.Last edit: Yeah, turns out to be a reported issue in the 0.4.9 version of clink, and fixed in the forked version.
@nephewtom commented on GitHub (Feb 12, 2022):
Ok, that makes sense, and clink came to my mind when it didn't work.
Thanks for taking the time to answer. 🙏
I am using clink's fork now and everything works.
Hurrah! 🥇
@falkenhawk commented on GitHub (Feb 18, 2022):
This worked for me:
@MonstraG commented on GitHub (Mar 4, 2022):
It seems I'm also one of the folks in the back.
Followed the guide, were not able to just create the profile file with
notepad $PROFILE.AllUsersAllHostsas for some reason, even elevated notepad cannot save things there, inWindowsApps\ps...folder (or elevated terminal doesn't start notepad elevated?).Had to settle for
$PROFILE.CurrentUserAllHosts, and it did sort of work, with a side effect.When opening a new tab in WSL, instead of
username@PC-NAME:~, I getPS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-20.04\home\username, as current path, which I guess is technically correct, but not what I want. Any solutions to that?@TBBle commented on GitHub (Mar 4, 2022):
Yeah,
$PROFILE.AllUsersAllHostsseems like the wrong directory, that'll be in the PowerShell installation directory; generally "AllUsers" is only for system admins to set (depending on how you installed PowerShell, it might be limited toTrustedInstaller). so for personal settings you want "CurrentUser" versions.That said, I put all these settings directly in
$PROFILEand it works fine for me, since I probably don't want these settings to apply to, e.g. VSCode's integrated terminal. (Or maybe I do, if they also supportOSC;9;9... Huh, I need to think about that.)@JahzVH commented on GitHub (May 9, 2022):
This works for Git Bash
export PROMPT_COMMAND='printf "\e]9;9;%s\e\\" "$(cygpath -w "$PWD")"'@RedFour commented on GitHub (May 17, 2022):
The guide for WSL does not work for me.
I'm on Windows 11 using WSL 2 and oh-my-posh.
I've added the following to the end of my bashrc file
I get the following error when I refresh my terminal:
@TBBle commented on GitHub (May 17, 2022):
@RedFour
I guess that the problem is that whatever adds
_omp_hooktoPROMPT_COMMANDearlier included a trailing semicolon, and the guide's command assumes that an existingPROMPT_COMMANDdoesn't do that, so it adds one before its new command, and this double-semicolon with no command between then is what bash's objecting to.So remove the semicolon after
PROMPT_COMMAND, i.e.I reckon this is a bug in oh-my-posh's bash support, because it assumes
PROMPT_COMMANDis already set and blindly adds the semicolon.You'd also find if you put the unchanged
PROMPT_COMMANDline from the Windows Terminal docs before the oh-my-posh setup line in your .bashrc, it works fine, as the Windows Terminal docs' command handles "No PROMPT_COMMAND set" correctly, and oh-my-posh will then prepend to that correctly.All that said, oh-my-posh has built-in OSC9;9 support, so you probably don't need this command at all, just set
osc99totruein your config and it'll include it without needing to modify your bash config (or anywhere else you're using oh-my-posh).@RedFour commented on GitHub (May 17, 2022):
Thanks @TBBle for explaining how to fix it.
After following your suggestions, I had to do the following changes to get it working for me.
wslpath -wfrom that line for bashrc file:Command line to use
wsl.exeinstead ofUbuntu.exeStarting directory to
\\wsl.localhost\Ubuntu\home\<username>https://github.com/microsoft/WSL/issues/6995 has more information on Windows Terminal unable to start in a linux path.
In the end I used the osc99 option in my oh-my-posh config instead of adding that extra line in the bashrc. Changing the Windows Terminal profile setting was also necessary with the oh-my-posh config option.
@zadjii-msft commented on GitHub (May 17, 2022):
Ah yes, that's something we need to work through with Canonical.
Ubuntu.exeseemingly totally disregards thestartingDirectory, which helps power this.@dotnetCarpenter commented on GitHub (May 18, 2022):
Dang! For some reason the solution from https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory stopped working in Windows Terminal 1.13.10983.0 (or before). It's working for window splitting (panes) but not for new tabs.
Using the Ubuntu image.
@TBBle commented on GitHub (May 19, 2022):
Are you using "new tab" or "duplicate tab". The former doesn't carry the working directory over.
@tristanbarcelon commented on GitHub (May 26, 2022):
I'm using new tab. Turns out the profile needs to properly escape single slash on Server 2022, something I didn't have to do in Windows 10/11. Fix mentioned by nuixtech fixed the issue. I have terminal installed on Windows 11 and Server 2022 (using the win10 msixbundle). This is how Ubuntu-20.04 profile looks on Windows 11.
On Server 2022, this is how it looks.
@TBBle commented on GitHub (May 27, 2022):
I don't understand how that makes a difference (because that path should be processed by Terminal, well before WSL sees it), but it might be worth opening as a separate specific bug report so it can be fixed in the code that auto-generates the profile, or if there's a bug elsewhere in Terminal causing this issue, that can be fixed instead.
@codtiger commented on GitHub (Oct 13, 2022):
Are there any updates on this ? I managed to make it work for "duplicate tab" by changing
ubuntu.exetowsl.exe -d Ubuntuin the profile section but it still does not work on new tab:(@InvisibleProgrammer commented on GitHub (Jan 6, 2023):
@codtiger , thank you for your answer. It saved me :D
One additional detail: with default settings, when I change
ubuntu.exetowsl.exe -d Ubuntu, the starting directory becomes the/mnt/c/WINDOWS/system32. To fix that, I've changed starting directory to~:@nileshgr commented on GitHub (Mar 13, 2023):
@codtiger @tristanbarcelon was irritated by this problem, thanks for the suggestions! 😄
@alkorlos commented on GitHub (May 27, 2023):
Good day!
I am using:
Windows 10 22H2
Windows Terminal 1.16.10261.0
Ubuntu 22.04.2 LTS
Following this instruction Tutorial: Opening a tab or pane in the same directory in Windows Terminal added to
.bash_profilelineAfter that, Windows Terminal began to remember directories, thanks!
But other problems arose, for example, nvm broke
Command 'nvm' not foundAdding these lines to
.bash_profilehelped fix this problemI decided to write this comment because neither in the article Tutorial: Opening a tab or pane in the same directory in Windows Terminal nor in this issue did I see that adding this line
to
.bash_profilemay cause additional problems.nvm is the first thing I tried to use, most likely there are more such problems. Did I do something wrong when I edited
.bash_profile? Or is it known that adding this line breaks paths or something like that?@TBBle commented on GitHub (May 27, 2023):
That line definitely shouldn't have broken stuff you described. It's not obvious how nvm was working, but my best-guess is that you actually newly created the
.bash_profile, and now bash is running that instead of some other file, like.profile, and your existing NVM setup was in that. This site suggests that this is the case, but I haven't looked myself. This answer suggests that maybe it's.bashrcthat is no longer being read, but that's older than Ubuntu 22.04.If that's the case, then you could either add the
PROMPT_COMMANDto.profile(or whatever it is) and delete the newly-created.bash_profile, or add something likesource ~/.profileto the start of your.bash_profile.@alkorlos commented on GitHub (May 27, 2023):
Thank you!
Important clarification — I did not do anything unusual, on the contrary, yesterday I performed a clean installation of
Ubuntu 22.04.2 LTS.After a clean install, I installed only
nvm. After that of the files listed here:.bash_profile,.bash_login,.profile, only exists.profile. File.bash_profileI created, as it was written here. In addition to the problem withnvm, there was a problem with colors, but I did not betray this.Indeed, adding
PROMPT_COMMANDto the.profileand deleting.bash_profilehelped.Thanks again! Cheers!
@TBBle commented on GitHub (May 28, 2023):
Okay, so it might make sense to add a note to the docs along the lines of "If
.bash_profiledoes not exist, but.profiledoes, add the line there instead", to avoid confusion for the default Ubuntu 22.04 setup and any similar situations.The current instructions do not say to create the file, but in this situation, it's a reasonable guess that happens to do the wrong thing.
I note the MINGW instructions use
.bashrcinstead, which won't have this problem. That's maybe a better choice, as it's specifically for interactive shells, IIUC.@daviewales commented on GitHub (Jun 9, 2023):
The creator of powerlevel10k has created a Zsh plugin for this.
He claims it "...achieves the same thing as the code snippet in the official Windows Terminal documentation but with fewer bugs and better performance".
Linking it here for visibility:
https://github.com/romkatv/windows-terminal-zsh-integration
@TBBle commented on GitHub (Jun 9, 2023):
I don't know the zsh ecosystem, but is that plugin widely-suitable-enough to be added as a preferred option to the Windows Terminal docs?
It's clearly too-long to inline into the docs (and is doing a lot more than the one-liner does, such as caching, some TMUX-specific magic and for some reason using
wslpath -amand mangling the output rather thanwslpath -w), but if general zsh users can do an extragit cloneover the current docs and get a much better result, then it seems like an easy win to me.If zsh plugin managers are commonly used, then that's even better, IMHO.
The main concern I envisage is making the docs dependent on an external site.
@Lajdre commented on GitHub (Jul 6, 2023):
In regard to comments made by alkorlos and TBBle.
This might help somebody in the future:
.bashrc.bash_profileif using.profile(then move PROMPT_COMMAND to.profileor.bashrc)On a few forums on the Internet it is advised to put "cd ~" or some variation of this in
.bashrcto change the starting directory. This can be overlooked and will obviously make PROMPT_COMMAND not produce the desired result.If you did not have
.bash_profileand you created it, as it was written here, PROMPT_COMMAND will work, given you put it in.bash_profile, however this will also "skip" your "config" (.bashrcand.profile)..bashrcis not "loaded" by default..profileis responsible for that, but it is also not always "loaded".First few lines of
.profile:Solutions:
.profileto.bash_profile. e.g.or
.bash_profileand put PROMPT_COMMAND in either.profileor.bashrc@deadcoder0904 commented on GitHub (Jan 16, 2024):
why is this not implemented even 5 years later?
i don't think this is unreasonable for any web developer working on a project that requires to spin up >2 scripts in the same directory.
@zadjii-msft commented on GitHub (Jan 16, 2024):
Well, I mean, it has and it hasn't.
You've been able to use shell integration to open a new tab/pane in the same CWD for a couple years now, using
OSC9;9. (osc9;9 was originally tracked in #8166) This thread is technically tracking a similar escape sequence,OSC7, which we haven't had a chance to come back around on yet (because it's got some trickier edge cases with WSL distros). #8214 (linked earlier in this thread) has some of the most complete discussion on the whole problem space.Alas, automagic CWD detection (like linux) will almost certainly never work, as some shells (cough powershell) don't actually set their CWD.
Then there's of course the potential for automatically modifying people's prompts, such that shell integration is automatically enabled for them. This is definitely something that I want to investigate going forward, maybe sometime next year. But I doubt that'll work for everyone or every shell.
@ewlondon commented on GitHub (Feb 10, 2024):
I know this is an old topic but I just wanted to say for anyone trying to get split panes to same directory using GitBash in 2024, adding this line to .bashrc finally worked for me. The previously listed command by JahzVH was not working correctly for me and would give an error ping every time a prompt was input into terminal.
PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND "}'printf "\e]9;9;%s\e\\" "$(cygpath -w "$PWD")"'@Daydreamer-riri commented on GitHub (Aug 18, 2024):
Hi @zadjii-msft , you mentioned shell integration which works fine in Powershell, but when I configure my wsl / zsh using the method described in it, the root directory still opens when I split the pane. I'm trying to understand if I'm missing something?
@TBBle commented on GitHub (Aug 18, 2024):
@Daydreamer-riri I'd suggest checking what settings are used to launch WSL. I don't know if it's still the default, but IIRC it used to default to including a path on the command line (so it wouldn't start in
C:\Windows\System32), and that would override the path provided by this feature.Also worth checking if you haven't already that nothing else in your zsh startup scripts are changing the current directory, e.g., see point 1 of https://github.com/microsoft/terminal/issues/3158#issuecomment-1624390767.
For example, this Ubuntu WSL config block works for me with the bash setup from the shell integration docs:
If changing the
startingDirectoryvalue changes the start directory successfully, then your zsh startup scripts are not overriding the directory set by this feature, at least, as that's the value this feature overrides.@Daydreamer-riri commented on GitHub (Aug 19, 2024):
Hi @TBBle, the settings in my Terminal are:

I found something interesting: when I use the former (which is, the source is
Windows.Terminal.Wsl), the path can be duplicate correctly. But it is hidden by default and the latter is used by default. The latter cannot duplicate the path correctly. Is this perhaps a bug?@TBBle commented on GitHub (Aug 19, 2024):
Try adding a manual commandLine to the non-working profile, something like
C:\Windows\System32\wsl.exe -d Ubuntu-24.04. I don't know what command line that dynamic profile source is actually providing on your machine, but my guess it it hard-codes the starting directory in some way. (You could also try adding astartingDirectoryvalue to it (~should work), since theWindows.Terminal.Wslprofile source generates one by default, but that shouldn't make a difference, and my research below suggests that it's the command-line.)Anyway, I did some more digging: I have a different Ubuntu build installed (
CanonicalGroupLimited.UbuntuonWindows_2004.2022.1.0_x64__79rhkp1fndgsc) but I checked its snippet (with this process), and it apparently just runs ubuntu.exe, which does (or at least used to) overridestartingDirectoryand hence is incompatible with this feature, so I'm fairly confident this is the problem.If you confirm that adding a
commandLineentry fixes the starting directory, then it's an issue specific to the Ubuntu-provided snippets (or a behaviour choice in their ubuntu.exe launcher, probably thefalsein this line, which was inherited from MS's template launcher project originally implemented by a familiar author) and you would need to raise it as a ticket with them to fix in some way. You're welcome to link or quote this comment in any such issue you raise.Edit: Gah. Turns out we already have a bug in this repo for this issue, #12961, which provides a simpler
commandLinevalue to use:ubuntu run. That possibly should be the default command in the Ubuntu snippet... along withstartingDirectoryvalue~as used by the WSL profile generator. So still an Ubuntu issue to fix, but not a difficult one.In short, I think this will work to fix your issue: In the second profile, add the following two lines to the start:
@Daydreamer-riri commented on GitHub (Aug 19, 2024):
Thank you very much for your survey. It's incredible to have accomplished so much work in such a short time.
However, after I added these two lines to the configuration, everything behaved the same as before, with no improvement.
@zadjii-msft commented on GitHub (Aug 19, 2024):
Did you set
"commandline"? or"commandLine"? (note the capitalL)The setup from the docs Works On My Machine when I don't use the profile that Canonical provides, and use the built-in WSL profiles instead:
Using the canonical profile: (

"commandline": "ubuntu2204.exe")Using the built-in dynamic profile: (

"commandline": "C:\WINDOWS\system32\wsl.exe -d Ubuntu-22.04")@Daydreamer-riri commented on GitHub (Aug 19, 2024):
I have not set up "commandline". The configuration was automatically generated after installing WSL:
When I set the
sourcetoWindows.Terminal.Wsl, the documentation works.@TBBle commented on GitHub (Aug 19, 2024):
Yes, that works because by changing the source, you're changing the profile you're inheriting from Ubuntu's one, to the built-in profile that includes the two lines I shared. If you do that, you may as well just unhide the actual profile generated by Windows Terminal, and hide the Ubuntu-generated one, to avoid any risk of confusion in-future. (If you go this way, you can add Ubuntu to the list of profile generators to ignore, and then remove that generated profile entirely, for a cleaner config file.)
Can you share the version of that profile with the two lines I provided added, that wasn't working, so if we can see if there's anything else needed?
I expect this should work, is that what you had?
@Daydreamer-riri commented on GitHub (Aug 19, 2024):
Sorry, the configuration you provided works, the reason I said it didn't work before was because I filled in the name of the executable wrong (my ubuntu version is 2404 but I wrote 2204). The only problem with it now is that my wsl default directory becomes my Windows user directory instead of the user directory in wsl.
When I set commandline to
wsl.exe -d Ubuntu-22.04:@TBBle commented on GitHub (Aug 19, 2024):
Ah yeah, sorry about getting the number wrong. I originally typed "2004" out of habit, and fixed it looking at the example in the other ticket, not your settings. >_<
Anyway, I'd go with the
wsl.exe -d Ubuntu-22.04command-line setting then. That should be all the launcher is doing underneath, after the first-run setup anyway.Otherwise, you can also put your real desired startup directory in the
startingDirectoryparameter, e.g., you can see in my earlier example I use//wsl$/Ubuntu/home/paulhwhich is/home/paulhinside the Ubuntu WSL install.If you navigate toEasier method: Go into the directory in WSL that you want to be your starting directory, and run\\wsl$in Windows Explorer, you should be able to get the correct path to use by browsing in there, but I assume it'll be something like\\wsl$\Ubuntu-2404\home\<yourWSLAccountName>. (My use of/is probably legacy here and only works with wsl.exe,\-based paths like you'd copy from Explorer should work, but remember to double the backslashes if you're editing the JSON directly. I just changed mine to use\and it works fine.)wslpath -w "$PWD". Put that in your config; if you're editing JSON directly, double the backslashes.Sadly, it turns out Windows Terminal makes the
~starting directory work by specifically looking for wsl.exe on the command line and otherwise turns it intoUSERPROFILEas you have discovered. There's a separate hack that specifically looks for the sourceWindows.Terminal.Wsl(used for drag-and-drop support AFAICT, see #17691) so clearly some outstanding work to be done to make this all work nicely out-of-the-box for WSL profiles/launchers other than the built-in default WSL profile generator.@Daydreamer-riri commented on GitHub (Aug 19, 2024):
Thank you! Thanks for your guidance.
I think it should be stated in the documentation that “Opening a tab or pane in the same directory” requires some extra work when using the default generated
"source": ‘CanonicalGroupLimited...profile”.Hopefully this will help more people.
@TBBle commented on GitHub (Aug 20, 2024):
The problem is the
"source": ‘CanonicalGroupLimited...profile” is not part of Windows Terminal, so I'd suggest you raise a suggestion with the project providing that source (https://github.com/ubuntu/WSL) to change it to work "better", or better-document the effect their profile has on Windows Terminal, and any extra steps the user needs to take to make it work.There's some work that could be done in Windows Terminal, but it wouldn't be Ubuntu-specific and would require coordination with any such WSL distributions in their profile contributions too.
@Lyton505 commented on GitHub (Oct 21, 2024):
Hi @Daydreamer-riri mentioned
CanonicalGroupLimited.Ubuntu_79rhkp1fndgscbeing faulty. I am also observing the same behaviour. How did you change it toWindows.Terminal.WslWhenever I try to change it insettings.json, I get the following error:@glokta1 commented on GitHub (Feb 9, 2025):
@TBBle Thank you very much! <3 I was encountering the same issue with the official documentation not working and your solution fixed it
@0anton commented on GitHub (Mar 17, 2025):
I cannot get terminal tab split into the current directory working. I've tried many options:
How can I troubleshoot what exactly is broken?
I've have two other Windows devices - on them the same works perfectly. I'm replicating the profiles one-to-one - and on the affected host the path is simply not taken over...
@nacitar commented on GitHub (Apr 7, 2025):
Just use "$PWD" in your prompt command, not "$(wslpath -w "$PWD")"
EDIT: and probably remove the starting directory bit too.
@0anton commented on GitHub (Apr 7, 2025):
thanks for the hint, @nacitar
I've tried w/o wslpath like:
it didn't work unfortunately:
what do you mean exactly with remove the starting directory bit too?
@nacitar commented on GitHub (Apr 7, 2025):
In your windows terminal settings:
I can confirm that mine works without that present and using PWD directly like I suggested. My guess is that is overriding it.
... also make sure you're using duplicateTab
@0anton commented on GitHub (Apr 8, 2025):
Thank you a lot @nacitar!
I'm unsure what has worked at the end, but this combination "does the needful":
I had to ensure I'm using duplicate pane: action
Simplified
PROMPT_COMMANDversion with just$PWDworks actually fine, so I've started using it:startingDirectory set to "current dir":
With all this I indeed can duplicate tab to the same dir, which saves a lot of time to me! Resolved to me.
@hktkqj commented on GitHub (Apr 9, 2025):
For those struggling to duplicate/split WSL tabs in same diretory, please ensure that the startup command line for the distribution profile uses
wsl -d <distro>instead ofubuntu2204.exelike executable, as for some reason this affects the passing of the CWD.@working-name commented on GitHub (Apr 19, 2025):
Right, or this default junk somehow generated:
Remove --cd ~, that forces to always cd into the linux user's home folder.
Thanks @0anton
@pavangayakwad commented on GitHub (May 3, 2025):
This is a commonsense and the most useful UX, really disappointed to see that it is not implemented till date. I just also wish Terminal remember its previous state when re-opened.