cs50 / check50

This is check50, a command-line program with which you can check the correctness of your programs.
GNU General Public License v3.0
399 stars 267 forks source link

Show html path within wsl #276

Closed TheRijn closed 2 years ago

TheRijn commented 2 years ago

Closes #275 Checking if we're running wsl using https://www.scivision.dev/python-detect-wsl/ Then converting the path within Ubuntu to a windows path with wslpath -w.

Tested with check50 cs50/problems/2021/fall/hello --local on macOS 12.2.1 with python 3.9.10 and WSL Ubuntu 20.04 with python 3.8.10

WSL result: To see the results in your browser go to file:///wsl.localhost/Ubuntu/tmp/tmpveuwk16x.html

macOS result: To see the results in your browser go to file:///var/folders/j9/6b_9k8xs3pzcf8pxp6g08twh0000gn/T/tmp3iev6si6.html

Jelleas commented 2 years ago

Tested again under a fresh install. Works fine in both WSL's Ubuntu terminal and the newish Windows terminal. Links should soon be clickable in Windows Terminal: https://github.com/microsoft/terminal/issues/7699

@rongxin-liu mind taking another look at this PR? We have a lot of WSL users and it'd be nice to have this merged 😀

rongxin-liu commented 2 years ago

Looks good, merging! Thank you @TheRijn @Jelleas @AalOsman