Skip to content

Improved python tool support#673

Open
marco-gallegos wants to merge 5 commits intoohmybash:masterfrom
marco-gallegos:gallem/uvsupport
Open

Improved python tool support#673
marco-gallegos wants to merge 5 commits intoohmybash:masterfrom
marco-gallegos:gallem/uvsupport

Conversation

@marco-gallegos
Copy link
Copy Markdown
Contributor

just a small update :)

Comment thread themes/developer/developer.theme.sh Outdated
Comment on lines +61 to +62
if [[ -n "$VIRTUAL_ENV" ]]; then
val_venv=" ($(echo "$VIRTUAL_ENV" | awk -F/ '{print $(NF-1)"/"$NF}'))"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what happens when VIRTUAL_ENV contains a newline in the path. The above would output multiple aaa/bbb pairs. Also, what happens when VIRTUAL_ENV doesn't contain any /? It would output / + $VIRTUAL_ENV, but I'm not sure if it's the intended behavior. I'd suggest simply doing

Suggested change
if [[ -n "$VIRTUAL_ENV" ]]; then
val_venv=" ($(echo "$VIRTUAL_ENV" | awk -F/ '{print $(NF-1)"/"$NF}'))"
if [[ $VIRTUAL_ENV =~ [^/]+/[^/]+$ ]]; then
val_venv=" ($BASH_REMATCH)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what happens when VIRTUAL_ENV doesn't contain any /?

This hasn't been answered. Or is it ensured that it VIRTUAL_ENV contains /?

Comment thread themes/developer/developer.theme.sh Outdated
Comment thread themes/developer/developer.theme.sh Outdated
marco-gallegos and others added 2 commits May 15, 2025 19:54
@marco-gallegos
Copy link
Copy Markdown
Contributor Author

Thank you about your review @akinomyoga I just pushed these changes to my branch

Comment thread themes/developer/developer.theme.sh Outdated
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.

2 participants