Follow

Wanted to get an MSYS2 shell inside ConsoleZ rather than being forced to use whatever the fuck terminal emulator it has by default.

Figured out I can do that with 2 lines of cursed bullshit in a Windows batch script:

set PATH=C:\msys64\usr\bin;C:\msys64\usr\local\bin;%PATH:;;=;%
bash -c 'cd ^&^& exec $(getent passwd "%USERNAME%" ^| cut -d: -f7) --login'

Β· Β· Web Β· 2 Β· 1 Β· 1

This cursed batch script
+ creating an /etc/passwd in MSYS2 and changing my shell
+ setting up Starship (which required some weird bullshit)

= nice shell environment in Windows

:blobcatsip:

The aforementioned weird bullshit to get Starship to work nicely is because Starship on Windows doesn't know jack shit about MSYS2 (even when compiled with Cargo inside MSYS2), so there's a couple little config changes, plus explicitly setting the STARSHIP_CONFIG environment variable in ~/.profile

starship.toml:

[directory]
use_logical_path = false
[directory.substitutions]
"C:/msys64/" = "/"
"/home/Iris System" = "~"

@u1f408 Not sure if the "Windows Terminal" instructions will help you figure it out for ConsoleZ? msys2.org/docs/terminals/
(I've never used ConsoleZ, I'm really sorry that I can't give more advice)

@Whovian9369 IIRC, msys2_shell.cmd completely ignores what shell you set in /etc/passwd and will always just start bash. This way works though!

@u1f408 Well nice job on your end, then! Glad ya got it working! :)

Sign in to participate in the conversation
Cybrespace

the mastodon instance at cybre.space is retiring

see the end-of-life plan for details: https://cybre.space/~chr/cybre-space-eol