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

Missing mc-wrapper.sh script #69

Open
fekir opened this issue Jan 29, 2024 · 0 comments
Open

Missing mc-wrapper.sh script #69

fekir opened this issue Jan 29, 2024 · 0 comments

Comments

@fekir
Copy link

fekir commented Jan 29, 2024

Unix environments have an mc-wrapper.sh script.
When used instead of powershell with alias mc='source mc-wrapper.sh', it makes it possible to change directory automatically after exiting from mc.

A possible implementation for powershell would look like

$mc_tmp_file = [System.IO.Path]::GetTempFileName()
& "${PSScriptRoot}/mc.exe" "--printwd=${mc_tmp_file}" "${args}"
$mc_path = get-content -Path "${mc_tmp_file}"
cd "${mc_path}"
remove-item -Force -Path "${mc_tmp_file}"

The file should be placed in the same installation directory of mc, and used from powerhsell as

Set-Alias -Name mc -Value "C:/.../mc-wrapper.ps1";

I do not know if it is possible to create something similar for cmd, but at least for powershell it is, and it would be nice if the setup would provide the script by default.

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

No branches or pull requests

1 participant