Better differentiation for relative vs absolute file paths
I guess I'm not sure if this is an issue for Ion specifically or Redox more generally... But I feel like Redox expanding the "Everything is a file" concept to be "Everything is a URL" means that it's in a good position to fix a very common user mistake.
The relative file paths ./file
and just file
are both only a single character away from the absolute file path /file
. So in basically every existing shell language, accidentally deleting or overwriting a file under root instead of the current working directory, or vice versa, is a fairly common mistake. The typo becomes more dangerous when combined with globs -- accidentally writing ./fiel
instead of ./file
will probably produce a "no such file" error, but rm -rf /*
and rm -rf ./*
will both always work. Obviously, it is up to the terminal user and script writer to proofread their own commands, but since this is such a common and dangerous mistake, it seems like it would have been a good idea to make sure relative and absolute paths have a greater difference than the absence or presence of a small single dot. Redox and Rust care a lot about code "safety" -- trying to avoid inevitably common typos maybe isn't quite what they meant, but I do feel like improving the safety of shell code in this area is at least a closely related idea.
I'm imagining file prefixes like here:
, relative:
, or cwd:
for relative paths, and root:
, absolute:
, or file:
for absolute paths, but you may think of something better. Removing the ./
and /
file path prefixes might be too controversial, I dunno, but having something like cwd:
and root:
or similar, at least as an option, would be nice.