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

Use generic_string for path on Windows unix shells #2685

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

AntoinePrv
Copy link
Member

Fix #2683

@jonashaag
Copy link
Collaborator

Can we add a test for this?

@AntoinePrv
Copy link
Member Author

Hmm, bash should already be tested on Windows so it is weird that we had a bug to start with...
Unless there are options to allow Windows paths on Windows bash?

@pavelzw
Copy link
Member

pavelzw commented Jul 18, 2023

I tested it on cygwin:

~/Documents $ ./micromamba.exe shell hook --shell=bash | grep "__mamba_exe()" -A 5
__mamba_exe() (
    "C:\Users\pavel\Documents\micromamba.exe" "${@}"
)

__mamba_hashr() {
    if [ -n "${ZSH_VERSION:+x}" ]; then

Unfortunately, it still uses the windows paths. (got the executable from this commit 0xbe7a@32846b1)

@AntoinePrv
Copy link
Member Author

I'm confused. @pavelzw can you try the last commit? The standard clearly states that the separator should be a /. Or am I not modifying the right function?

@pavelzw
Copy link
Member

pavelzw commented Jul 22, 2023

Just tried it with a brand-new windows server instance with cygwin installed. There, it still uses the windows paths.

admin@windows-server /cygdrive/c/Users/admin/Downloads
$ ./micromamba shell hook -s bash

# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

__mamba_exe() (
    "C:\Users\admin\Downloads\micromamba.exe" "${@}"
)
...

I used the executable from 73b0f54 (#2685).

@AntoinePrv AntoinePrv requested a review from Klaim August 1, 2023 10:20
Copy link
Member

@Klaim Klaim left a comment

Choose a reason for hiding this comment

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

I'm approving this but worry that the paths displayed might be misleading to users. Maybe displaying both on windows would be best?

@AntoinePrv
Copy link
Member Author

@Klaim there is no displaying in this PR. This are activation scripts being run when using micromamba activate (the ones that set env variables).

@Klaim
Copy link
Member

Klaim commented Aug 28, 2023

Ok I thought these paths were also displayed when doing micromamba activate but anyway thanks for clarifying.

@AntoinePrv
Copy link
Member Author

Let's give it a try

@AntoinePrv AntoinePrv merged commit 65c061f into mamba-org:main Aug 28, 2023
28 checks passed
@AntoinePrv AntoinePrv deleted the fix-shell-cgywin branch August 28, 2023 13:21
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.

Micromamba >v1.4.5 broken with cygwin
4 participants