Skip to content

fix(vscode): prevent vscode from adding extra line#381

Merged
edouard-lopez merged 3 commits intomasterfrom
fix-prompt-contains-newline-in-vscode-terminal-341
Sep 22, 2025
Merged

fix(vscode): prevent vscode from adding extra line#381
edouard-lopez merged 3 commits intomasterfrom
fix-prompt-contains-newline-in-vscode-terminal-341

Conversation

@edouard-lopez
Copy link
Member

@edouard-lopez edouard-lopez commented Sep 13, 2025

Thanks to @wyw message
microsoft/vscode#187185 (comment)

Test

❯ fisher remove pure-fish/pure
❯ fisher install pure-fish/pure@fix/prompt-contains-newline-in-vscode-terminal-341
❯ echo $pure_version
4.11.3-341
  • enable terminal.integrated.shellIntegration.enabled settings
  • Kill terminal in VSCode
  • re-open terminal in vscode

fixes #341 #379

@edouard-lopez
Copy link
Member Author

edouard-lopez commented Sep 13, 2025

@Perlence @MrAru could you try this PR in VSCode.

Failed MacOS tests

However, I noted it's messing test on MacOS.

not ok 249 fish_prompt: use 2-lines prompt by default
  ---
    operator: =
    expected: 1
    actual: '       1'
    at: ~/work/pure/pure/tests/fish_prompt.test.fish:62
  ...
not ok 250 fish_prompt: use 1-line compact-prompt
  ---
    operator: =
    expected: 0
    actual: '       0'
    at: ~/work/pure/pure/tests/fish_prompt.test.fish:67

Checking Single Line feature

Could you also check in a normal terminal for any issue related to pure_enable_single_line_prompt when switching it true/false?

~
❯ set --universal pure_enable_single_line_prompt true
~ ❯ set --universal pure_enable_single_line_prompt false

~
❯ 

If the rendering is correct, I will fix the test. Otherwise, I will have to weight the time to debug (I don't have MacOS) versus the added value of the feature with shell integration enabled in vscode.

@Perlence
Copy link

I can confirm that this fix works in VS Code.

I think the single-line prompt renders correctly. Here's Terminal.app:

image

And here's Alacritty 0.15.1:

image

@edouard-lopez Thanks for debugging and fixing this! ❤️

@edouard-lopez edouard-lopez force-pushed the fix-prompt-contains-newline-in-vscode-terminal-341 branch 5 times, most recently from 34e67cb to b41a5d7 Compare September 22, 2025 10:00
@edouard-lopez edouard-lopez force-pushed the fix-prompt-contains-newline-in-vscode-terminal-341 branch 2 times, most recently from adcd081 to 22a009f Compare September 22, 2025 15:12
@edouard-lopez edouard-lopez merged commit a4fd7ba into master Sep 22, 2025
5 of 6 checks passed
@edouard-lopez edouard-lopez deleted the fix-prompt-contains-newline-in-vscode-terminal-341 branch September 22, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pure prompt contains newline in VSCode terminal

2 participants