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

Update prompt conflicts with VSCode python venv functionality #12307

Open
marcospgp opened this issue Mar 27, 2024 · 10 comments
Open

Update prompt conflicts with VSCode python venv functionality #12307

marcospgp opened this issue Mar 27, 2024 · 10 comments
Assignees
Labels
Area: updater Update subsystem Bug Something isn't working

Comments

@marcospgp
Copy link

Describe the bug

VSCode python venv functionality runs source venv/bin/activate on terminal startup

Update prompt from oh my zsh captures the first character

image

Steps to reproduce

See above

Expected behavior

See above

Screenshots and recordings

No response

OS / Linux distribution

MacOS

Zsh version

5.8.1

Terminal emulator

VSCode

If using WSL on Windows, which version of WSL

None

Additional context

No response

@carlosala
Copy link
Member

carlosala commented Apr 4, 2024

Hi! That's an unfortunate corner case. I think changing the way omz updates in vscode could be counterproductive for users that don't use the venv integration. Instead of using vscode python venv, you could try our python plugin or disable the whole upgrade system if the terminal where zsh is running is vscode, as follows (before sourcing oh-my-zsh.sh):

[[ $TERM_PROGRAM == vscode ]] && zstyle ':omz:update' mode disabled

@marcospgp
Copy link
Author

Could a simple check for incoming input on shell startup suffice? I assume VSCode sends its command right away, faster than a human would, so a simple check for input before prompting user to update could solve the issue for VSCode and any other automated shell-creating programs that could interfere with ohmyzsh and have ohmyzsh interfere with them

@carlosala
Copy link
Member

carlosala commented Apr 4, 2024

The problem is that the input comes after the shell is initialized, that's why the first char gets cached by the update system.
If the input comes before the question, it already catches it and skips update.

@marcospgp
Copy link
Author

marcospgp commented Apr 4, 2024

what if the update prompt simply tells the user to run an update command and doesn't directly ask/listen for a y/n input?

@carlosala
Copy link
Member

You can choose that as well by setting the update mode reminder. You can read about it in the README!

@marcospgp
Copy link
Author

But given the wide adoption of VSCode as an editor is there a chance we could make the case for having that as a default?

@mcornella
Copy link
Member

I think that's an idea in the short run, let's add the check ourselves, but ideally in the long run I'd like to have a better solution for delayed initial input.

@mcornella mcornella reopened this Apr 5, 2024
@mcornella mcornella self-assigned this Apr 5, 2024
@mcornella mcornella added Bug Something isn't working Area: updater Update subsystem labels Apr 5, 2024
@ka1amita
Copy link

ka1amita commented Apr 27, 2024

I experienced the same issue with cat > <newfile> and touch <newfile> in IntelliJ terminal when propted for the update.

Ok imediatelly after update

@mcornella
Copy link
Member

I'm not able to reproduce this in VS Code (tried following [1] to no avail), and I don't have IntelliJ installed to reproduce this. Could you write a bullet point list of the steps to set this up, and confirm that you're in the latest OMZ version?

@marcospgp
Copy link
Author

marcospgp commented May 1, 2024

Why not just avoid capturing initial terminal output, which anecdotally conflicts with more than one application? I think a prompt that asks the user to run a command to update would work just as well in all instances, no?

Is there a big advantage in capturing input? Forcing the user to decide immediately whether they want to update (seems a bit intrusive)?

I appreciate all your effort here, just an idea of what I would do here 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: updater Update subsystem Bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

4 participants