mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

clicking file paths in terminal instantly kills the window #347

Closed noteventhrice closed 7 months ago

noteventhrice commented 11 months ago

I can provide exact commits of my build if needed (built from latest masters of wsltty and mintty last night), this is the same issue as https://github.com/mintty/wsltty/issues/346 except it's filepaths instead of URLs.

Not a deal breaker for me personally, just something I've noticed.

Feel free to close issue if it cannot be reproduced.

mintty commented 11 months ago

Works here for file paths. Please describe a reproducible case.

noteventhrice commented 11 months ago

This was not an official release build to be clear - if still unreproducible feel free to close, I can recreate if I encounter it on the next official release - this is not a critical issue

Built in a fresh windows vm within cygwin, following the guide in the readme, normal-installer

built and moved over to my daily driver: wsltty version 14f6d1e631b2c0738a2be8ecd125d595987eb540 mintty version a55d3e783d263bd6daf31b30765cefc9cdd40eac

Environment details: https://github.com/mintty/wsltty/issues/346

Behavior: Links work as expected Valid and invalid file paths crash - I believe this isn't strictly a file path issue

https://github.com/mintty/wsltty/assets/7583394/0b4843b4-d8fd-4925-949a-dad6835ee999

mintty commented 11 months ago

The second is not supposed to open the file as it's not valid WSL path syntax. Of course it's not supposed to crash either. Do you run mintty with an explicit WSL distro selected? That is for example --WSL=Debian rather than the default distro --WSL. If not, please try that. I'd look further in function wslwinpath (winmain.c). I can prepare some printf style debug statements and provide them to you. To be able to see them, mintty would need to be started from a cygwin command line, not a Windows shortcut. You are welcome to try yourself before I find the time...

noteventhrice commented 11 months ago

Thanks for clarifying - I can look into this further, URLs working was far more important than directories :) I did run mintty without explicitly selecting a distro (--WSL=), however adding it (--WSL="Ubuntu-20.04")didn't change the behavior - it was worth a shot!

mintty commented 11 months ago

Can you please check what the following command, issued from cygwin, says: wsl -d Debian sh -c 'wslpath -m /mnt/c/Users 2>/dev/null' (replace Debian with your distribution, /mnt/c/Users with your file pathname)

mintty commented 11 months ago

I've added some debug output to WSL path handling. Please compile with make CCOPT=-Ddebug_guardpath and run from a cygwin shell.

noteventhrice commented 11 months ago

Thanks, will try to check - have since confirmed this also occurs on windows 11

mintty commented 7 months ago

Fixed in 3.7.1.