... this is an "unlikely goal". I'd like to suggest to make it a "likely goal" instead since it works reasonably well on Windows 10 over the WSL.
So the two things missing to make it a mostly charming experience (minus the "spaces in filenames" issue ;-)) are:
A wrapper cmd script that allows one to start sam over a desktop icon or something. I currently use a PowerShell command for that, but that could be easier. I have a desktop shortcut to:
powershell.exe -windowstyle hidden -command "&{ bash -ic sam }"
Something like that, probably.
A method to rewrite native WSL paths to Windows paths. /mnt/c/Users/... is horrible. A Windows version of sam should be able to read and write Windows paths (and maybe translate it internally).
Rough draft without a single moment of checking if it even builds:
char file_path = "/mnt/c/some_file.txt";
/ ... some more code ... */
/* If "Microsoft" is in here, this is probably the WSL. */
if (strstr(line, "Microsoft") != NULL) {
/* Do translation stuff, e.g. "/mnt/c/" -> "C:\" etc. */
/* ... */
}
fclose(version_file);
So ...
... this is an "unlikely goal". I'd like to suggest to make it a "likely goal" instead since it works reasonably well on Windows 10 over the WSL.
So the two things missing to make it a mostly charming experience (minus the "spaces in filenames" issue ;-)) are:
A wrapper
cmd
script that allows one to startsam
over a desktop icon or something. I currently use a PowerShell command for that, but that could be easier. I have a desktop shortcut to:powershell.exe -windowstyle hidden -command "&{ bash -ic sam }"
Something like that, probably.
A method to rewrite native WSL paths to Windows paths.
/mnt/c/Users/...
is horrible. A Windows version ofsam
should be able to read and write Windows paths (and maybe translate it internally).Rough draft without a single moment of checking if it even builds:
char file_path = "/mnt/c/some_file.txt"; / ... some more code ... */
/ Check for a Windows environment: / FILE version_file; if ((version_file = fopen("/proc/version_signature","r")) != NULL) { / This file should be the same everywhere ... / / Related: https://www.reddit.com/r/bashonubuntuonwindows/comments/8ra282/is_there_a_way_to_semireliably_check_for_a/e0pmfui */ char line[100]; fscanf(version_file, "%s", line);
}