Skip to content
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

New Terminal output adding spaces and % resulting in cut off when activating Python environments (venv) #192018

Closed
slimsnerdy opened this issue Aug 24, 2023 · 13 comments
Assignees

Comments

@slimsnerdy
Copy link

slimsnerdy commented Aug 24, 2023

Does this issue occur when all extensions are disabled?: Yes/No
Yes (only Python/Pylance installed since needed)

  • VS Code Version: 1.81.1
  • OS Version: macOS Ventura 13.5.1

Steps to Reproduce:

  1. Open Command Palette --> Python: Create Environment --> Venv --> Python (I chose Python 3.10.12 64-bit) --> requirements.txt (leave unchecked) click OK

  2. Now create a new terminal; this is the strange part.. Sometimes it will add a % and a whole bunch of spaces when "activating" the environment.. look at the line with source.. the_slim_fatty_p% rod/.venv/bin/activate
    That is actually a bunch of spaces. Right click the Terminal window and "Toggle Size to Content Width" to see.

Sometimes creating a new terminal does not do this behavior and no spaces are added and that weird %.
This happens on new machines too. New projects from scratch. Python and macOS only tested.
Very random behavior; quickest way to test is click the plus icon on the bottom right to open new terminals so it activates in rapid succession and most of the time it actually does not add the spaces to the output. But every 4 or 5 clicks it does.. I have no idea.

Screenshot 2023-08-24 at 11 14 56

CORRECT BEHAVIOR:
Screenshot 2023-08-24 at 11 00 02

INCORRECT BEHAVIOR:
Screenshot 2023-08-24 at 10 59 43

Tasks

Preview Give feedback
No tasks being tracked yet.
@karthiknadig karthiknadig removed their assignment Aug 28, 2023
@karthiknadig karthiknadig transferred this issue from microsoft/vscode Aug 28, 2023
@karrtikr
Copy link
Contributor

@meganrogge We simply send the command source <activate> to VS Code, how it appears in terminal is not something we have control over.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 28, 2023
@karrtikr
Copy link
Contributor

karrtikr commented Aug 28, 2023

  • @slimsnerdy Can you provide the Python logs?

    Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

@slimsnerdy

This comment was marked as resolved.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Aug 31, 2023
@karrtikr

This comment was marked as resolved.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 31, 2023
@slimsnerdy

This comment was marked as resolved.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Sep 1, 2023
@slimsnerdy
Copy link
Author

nevermind I had to select "Python" from the dropdown
Screenshot 2023-08-31 at 18 40 38

@slimsnerdy

This comment was marked as off-topic.

@slimsnerdy

This comment was marked as off-topic.

@karrtikr

This comment was marked as off-topic.

@karrtikr
Copy link
Contributor

karrtikr commented Sep 1, 2023

Regarding the main issue in hand, it can be confirmed from the logs indicate that Python sent the right command in terminal, so transferring this issue to VS Code as indicated here: #192018 (comment).

@karrtikr karrtikr assigned meganrogge and unassigned karrtikr Sep 1, 2023
@karrtikr karrtikr transferred this issue from microsoft/vscode-python Sep 1, 2023
@slimsnerdy
Copy link
Author

warning] Microvenv failed as it is using proposed API which is constantly changing [TypeError: this.context.getEnvironmentVariableCollection is not a function

That issue should go away once you update your pre-release version of the extension., it's duplicate of microsoft/vscode-python#21831.

thank you; I will check

@vscodenpa vscodenpa added the stale Issues that have not been triaged in an appropriate amount of time label Sep 8, 2023
@deepak1556 deepak1556 assigned Tyriar and unassigned deepak1556 Sep 11, 2023
@deepak1556 deepak1556 removed the stale Issues that have not been triaged in an appropriate amount of time label Sep 11, 2023
@Tyriar
Copy link
Member

Tyriar commented Sep 11, 2023

This is happening because you're using sendText before the shell is initialized. The only way to fix this is via a timeout (which is unreliable) or via a yet to come executeCommand API. The % stuff is just that messing up zsh's standup startup

@Tyriar Tyriar assigned karrtikr and unassigned Tyriar and meganrogge Sep 11, 2023
@karrtikr
Copy link
Contributor

FWIW we do wait on terminal to open:

image

Regardless, this issue should not be happening with microsoft/vscode-python#11039, closing this.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants