Skip to content

Integrated terminal with starship prompt prints \x1b[0m #250129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trallnag opened this issue May 30, 2025 · 2 comments
Open

Integrated terminal with starship prompt prints \x1b[0m #250129

trallnag opened this issue May 30, 2025 · 2 comments
Assignees

Comments

@trallnag
Copy link

trallnag commented May 30, 2025

Type: Bug

  1. Install Starship and configure it so that it is automatically started in PowerShell.
  2. Open new integrated terminal in VS Code.

VS Code version: Code 1.100.2 (848b80a, 2025-05-14T21:47:40.416Z)
OS version: Windows_NT x64 10.0.26100
PowerShell version: 7.5.1
starship version: 1.23.0

System Info
Item Value
CPUs AMD Ryzen 7 7700X 8-Core Processor (16 x 4491)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.09GB (15.47GB free)
Process Argv . --crash-reporter-id 260ad335-63be-4f27-b055-e91d391f2eb8
Screen Reader no
VM 25%

Extensions disabled

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551cf:31249601
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
vscrpc:30673769
a9j8j154:30646983
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
pythonpulldiagcf:31316724
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31314202
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

Trace logs terminal
2025-05-30 19:12:26.305 [trace] [1748625] Reconnected to local terminals []
2025-05-30 19:12:26.305 [trace] [1748625] Pty host ready []
2025-05-30 19:12:32.483 [trace] [1748625] terminalInstance#ctor (instanceId: 1) [{"shellIntegrationEnvironmentReporting":false}]
2025-05-30 19:12:32.526 [debug] [1748625] Unbinding from mouse events. []
2025-05-30 19:12:32.552 [debug] [1748625] Starting pty host []
2025-05-30 19:12:32.552 [trace] [1748625] Renderer->PtyHost#connect: before acquirePort []
2025-05-30 19:12:32.579 [trace] [1748625] Webgl was loaded []
2025-05-30 19:12:32.586 [debug] [1748625] The terminal's pty host process is starting []
2025-05-30 19:12:32.591 [trace] [1748625] Renderer->PtyHost#connect: connection established []
2025-05-30 19:12:32.771 [debug] [1748625] Terminal process ready (shellProcessId: 8368) []
2025-05-30 19:12:32.773 [debug] [1748625] terminalInstance added capability [3]
2025-05-30 19:12:32.798 [debug] [1748625] parsing data "�[?9001h�[?1004h�[?25l�[2J�[m�[H

�[H�]0;C:\Program Files\PowerShell\7\pwsh.exe��[?25h" [[27,91,63,57,48,48,49,104,27,91,63,49,48,48,52,104,27,91,63,50,53,108,27,91,50,74,27,91,109,27,91,72,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,27,91,72,27,93,48,59,67,58,92,80,114,111,103,114,97,109,32,70,105,108,101,115,92,80,111,119,101,114,83,104,101,108,108,92,55,92,112,119,115,104,46,101,120,101,7,27,91,63,50,53,104]]
2025-05-30 19:12:32.798 [debug] [1748625] sending data "�[I" [[27,91,73]]
2025-05-30 19:12:33.217 [debug] [1748625] parsing data "�]633;P;PromptType=starship��]633;P;HasRichCommandDetection=True�" [[27,93,54,51,51,59,80,59,80,114,111,109,112,116,84,121,112,101,61,115,116,97,114,115,104,105,112,7,27,93,54,51,51,59,80,59,72,97,115,82,105,99,104,67,111,109,109,97,110,100,68,101,116,101,99,116,105,111,110,61,84,114,117,101,7]]
2025-05-30 19:12:33.218 [debug] [1748625] terminalInstance added capability [2]
2025-05-30 19:12:33.233 [debug] [1748625] parsing data "�]633;P;ContinuationPrompt=\x1b[90m��\x1b[0m �]633;P;IsWindows=True�" [[27,93,54,51,51,59,80,59,67,111,110,116,105,110,117,97,116,105,111,110,80,114,111,109,112,116,61,92,120,49,98,91,57,48,109,7,7,92,120,49,98,91,48,109,32,27,93,54,51,51,59,80,59,73,115,87,105,110,100,111,119,115,61,84,114,117,101,7]]
2025-05-30 19:12:33.264 [debug] [1748625] parsing data "
" [[13,10]]
2025-05-30 19:12:33.310 [debug] [1748625] parsing data "�]633;A��]633;P;Cwd=C:\x5cUsers\x5cTrallnag��[38;2;12;134;150m�[1m
~�[m �[32m�[1m
❯�[m �]633;B�" [[27,93,54,51,51,59,65,7,27,93,54,51,51,59,80,59,67,119,100,61,67,58,92,120,53,99,85,115,101,114,115,92,120,53,99,84,114,97,108,108,110,97,103,7,27,91,51,56,59,50,59,49,50,59,49,51,52,59,49,53,48,109,27,91,49,109,13,10,126,27,91,109,32,27,91,51,50,109,27,91,49,109,13,10,10095,27,91,109,32,27,93,54,51,51,59,66,7]]
2025-05-30 19:12:33.310 [debug] [1748625] CommandDetectionCapability#handlePromptStart [0,1]
2025-05-30 19:12:33.310 [debug] [1748625] terminalInstance added capability [0]
2025-05-30 19:12:33.333 [debug] [1748625] CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted commandStart ["1 -> 3:1"]
2025-05-30 19:12:33.333 [trace] [1748625] PromptInputModel#onDidStartInput ["|"]
2025-05-30 19:12:33.333 [trace] [1748625] PromptInputModel#onDidChangeInput ["|"]
2025-05-30 19:12:33.333 [debug] [1748625] CommandDetectionCapability#_handleCommandStartWindows [1,3]
2025-05-30 19:12:37.922 [debug] [1748625] sending data "�[O" [[27,91,79]]
2025-05-30 19:12:37.922 [trace] [1748625] PromptInputModel#_sync: | []
2025-05-30 19:12:45.177 [debug] [1748625] sending data "�[I" [[27,91,73]]
2025-05-30 19:12:45.177 [trace] [1748625] PromptInputModel#_sync: | []
2025-05-30 19:12:45.179 [debug] [1748625] sending data "�[O" [[27,91,79]]
2025-05-30 19:12:45.179 [trace] [1748625] PromptInputModel#_sync: | []
2025-05-30 19:12:58.028 [debug] [1748625] sending data "�[I" [[27,91,73]]
2025-05-30 19:12:58.028 [trace] [1748625] PromptInputModel#_sync: | []
2025-05-30 19:12:58.068 [debug] [1748625] sending data "�[O" [[27,91,79]]
2025-05-30 19:12:58.068 [trace] [1748625] PromptInputModel#_sync: | []

Trace logs pty host (filtered)
2025-05-30 19:12:32.770 [trace] [RPC Event] PtyService#_onProcessReady.fire({"id":1,"event":{"pid":8368,"cwd":"C:\\Users\\Trallnag","windowsPty":{"backend":"conpty","buildNumber":26100}}})
2025-05-30 19:12:32.770 [trace] [RPC Response] PtyService#start {"injectedArgs":["-noexit","-command","try { . \"c:\\Users\\Trallnag\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1\" } catch {}"]}
2025-05-30 19:12:32.777 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":1,"property":{"type":"title","value":"pwsh.exe"}})
2025-05-30 19:12:32.777 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":1,"property":{"type":"shellType"}})
2025-05-30 19:12:32.777 [trace] [RPC Request] PtyService#resize(1, 147, 14)
2025-05-30 19:12:32.777 [trace] node-pty.IPty#resize 147 14
2025-05-30 19:12:32.777 [trace] [RPC Response] PtyService#resize undefined
2025-05-30 19:12:32.777 [trace] [RPC Request] PtyService#resize(1, 153, 14)
2025-05-30 19:12:32.778 [trace] node-pty.IPty#resize 153 14
2025-05-30 19:12:32.778 [trace] [RPC Response] PtyService#resize undefined
2025-05-30 19:12:32.782 [trace] node-pty.IPty#onData �[?9001h�[?1004h
2025-05-30 19:12:32.783 [trace] node-pty.IPty#onData �[?25l�[2J�[m�[H

�[H�]0;C:\Program Files\PowerShell\7\pwsh.exe��[?25h
2025-05-30 19:12:32.797 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\u001b[?9001h\u001b[?1004h\u001b[?25l\u001b[2J\u001b[m\u001b[H\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\u001b[H\u001b]0;C:\Program Files\PowerShell\7\pwsh.exe\u0007\u001b[?25h"})
2025-05-30 19:12:32.800 [trace] [RPC Request] PtyService#input(1, "\u001b[I")
2025-05-30 19:12:32.800 [debug] MutationLogger "Persistent process "1" interaction state" set to "Session", reason: input
2025-05-30 19:12:32.800 [trace] node-pty.IPty#write �[I
2025-05-30 19:12:32.800 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:33.211 [trace] node-pty.IPty#onData �]633;P;PromptType=starship�
2025-05-30 19:12:33.212 [trace] node-pty.IPty#onData �]633;P;HasRichCommandDetection=True�
2025-05-30 19:12:33.216 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\u001b]633;P;PromptType=starship\u0007\u001b]633;P;HasRichCommandDetection=True\u0007"})
2025-05-30 19:12:33.221 [trace] node-pty.IPty#onData �]633;P;ContinuationPrompt=\x1b[90m��
2025-05-30 19:12:33.224 [trace] node-pty.IPty#onData \x1b[0m �]633;P;IsWindows=True�
2025-05-30 19:12:33.233 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\u001b]633;P;ContinuationPrompt=\x1b[90m\u0007\u0007\x1b[0m \u001b]633;P;IsWindows=True\u0007"})
2025-05-30 19:12:33.248 [trace] node-pty.IPty#onData

2025-05-30 19:12:33.262 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\r\n"})
2025-05-30 19:12:33.275 [trace] [RPC Request] PtyService#updateIcon(1, false, {"id":"terminal-powershell"}, )
2025-05-30 19:12:33.275 [trace] [RPC Response] PtyService#updateIcon undefined
2025-05-30 19:12:33.275 [trace] [RPC Request] PtyService#setTerminalLayoutInfo({"workspaceId":"1748625140201","tabs":[{"isActive":true,"activePersistentProcessId":1,"terminals":[{"relativeSize":1,"terminal":1}]}]})
2025-05-30 19:12:33.275 [trace] [RPC Response] PtyService#setTerminalLayoutInfo undefined
2025-05-30 19:12:33.291 [trace] node-pty.IPty#onData �]633;A��]633;P;Cwd=C:\x5cUsers\x5cTrallnag��[38;2;12;134;150m�[1m
�[m �[32m�[1m
❯�[m �]633;B�
2025-05-30 19:12:33.303 [trace] [RPC Request] PtyService#updateTitle(1, "pwsh", 2)
2025-05-30 19:12:33.303 [trace] [RPC Response] PtyService#updateTitle undefined
2025-05-30 19:12:33.309 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\u001b]633;A\u0007\u001b]633;P;Cwd=C:\x5cUsers\x5cTrallnag\u0007\u001b[38;2;12;134;150m\u001b[1m\r\n
\u001b[m \u001b[32m\u001b[1m\r\n❯\u001b[m \u001b]633;B\u0007"})
2025-05-30 19:12:33.310 [debug] CommandDetectionCapability#handlePromptStart 0 1
2025-05-30 19:12:33.340 [debug] CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted commandStart 1 -> 3:1
2025-05-30 19:12:33.340 [trace] PromptInputModel#onDidStartInput |
2025-05-30 19:12:33.340 [trace] PromptInputModel#onDidChangeInput |
2025-05-30 19:12:33.340 [debug] CommandDetectionCapability#_handleCommandStartWindows 1 3
2025-05-30 19:12:34.119 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":1,"property":{"type":"shellType","value":"pwsh"}})
2025-05-30 19:12:34.119 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":1,"property":{"type":"title","value":"pwsh.exe"}})
2025-05-30 19:12:37.925 [trace] [RPC Request] PtyService#input(1, "\u001b[O")
2025-05-30 19:12:37.925 [trace] node-pty.IPty#write �[O
2025-05-30 19:12:37.925 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:45.181 [trace] [RPC Request] PtyService#input(1, "\u001b[I")
2025-05-30 19:12:45.181 [trace] node-pty.IPty#write �[I
2025-05-30 19:12:45.181 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:45.181 [trace] [RPC Request] PtyService#input(1, "\u001b[O")
2025-05-30 19:12:45.181 [trace] node-pty.IPty#write �[O
2025-05-30 19:12:45.182 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:45.680 [trace] [RPC Request] PtyService#setTerminalLayoutInfo({"workspaceId":"1748625140201","tabs":[{"isActive":true,"activePersistentProcessId":1,"terminals":[{"relativeSize":1,"terminal":1}]}]})
2025-05-30 19:12:45.680 [trace] [RPC Response] PtyService#setTerminalLayoutInfo undefined
2025-05-30 19:12:58.029 [trace] [RPC Request] PtyService#input(1, "\u001b[I")
2025-05-30 19:12:58.029 [trace] node-pty.IPty#write �[I
2025-05-30 19:12:58.029 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:58.073 [trace] [RPC Request] PtyService#input(1, "\u001b[O")
2025-05-30 19:12:58.073 [trace] node-pty.IPty#write �[O
2025-05-30 19:12:58.073 [trace] [RPC Response] PtyService#input undefined
2025-05-30 19:12:58.534 [trace] [RPC Request] PtyService#setTerminalLayoutInfo({"workspaceId":"1748625140201","tabs":[{"isActive":true,"activePersistentProcessId":1,"terminals":[{"relativeSize":1,"terminal":1}]}]})
2025-05-30 19:12:58.534 [trace] [RPC Response] PtyService#setTerminalLayoutInfo undefined

The problem does not occur in Windows Terminal.

Screenshot:

Image

Similar issues:

@albertosantini
Copy link

Same setup (pwsh 7.5.1 and starship 1.23, preset Gruvbox) here and I cannot reproduce it.

Image

Last two lines of Microsoft.PowerShell_profile.ps1

...
Invoke-Expression (& { (starship init powershell) })
Invoke-Expression (& { (zoxide init powershell | Out-String) })

No VSCode settings related to the terminal.

In your context maybe just try to disable shell integration (just to troubleshoot the issue)

"terminal.integrated.shellIntegration.enabled": false

@trallnag
Copy link
Author

The issue does not occur with terminal.integrated.shellIntegration.enabled set to false.

The issue does not occur with terminal.integrated.windowsEnableConpty set to false.

terminal.integrated.shellIntegration.decorationsEnabled doesn't do anything regarding the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants