- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
You’ve come from Windows and have brought dangerous expectations.
MacOS has a case insensitive file system. It causes me untold grief
Is a 40 year old it guy who love linux, wat
Macos is case insensitive?!
OSX offers both case sensitive and case insensitive filesystems
Defaults to insensitive and if you want to change it you have to reformat 🥲
I’ve been using case insensitive fs on macOS for years and the only software having issues with this is onedrive.
can’t say i’m surprised.
I have issues with Docker a lot. Example: Rename a file from “File.js” to “file.js” in a dependency and it’s like something caches the old name so even when I redownload or install that dep it tries the old name and fails to find the file. Might just be me and my tomfoolery
if you’re renaming from
File.js
tofile.ts
, which is also changing suffixes instead of just capitalization, then that couldn’t be explained by case sensitivity, unless it was a typo and you meantFile.js
tofile.js
This is likely because docker runs Linux in a VM on MacOS right?
We’ve had similar problems with stuff that works on the developers Mac but not the server which is case sensitive. It can be quite insidious if it does not cause an immediate “file not found”-error but say falls back to a default config because the provided one has the wrong casing.
That isn’t true.
Which part? I’d love to switch if there’s no reformatting, and if your exception is with the first part, I’d ask for some evidence. All of my mac machines arrived brand new, case insensitive. Granted that’s only 3 so far, but it’s a smattering from 2019 onward. All the literature online points to this being the default too
Wow, I figured it’d be case sensitive, crazy, gotta make it more windows like I guess.
Why would case sensitive path names be considered dangerous?
I don’t know about dangerous, but case-insensitive Unicode comparison is annoying, expensive and probably prone to footguns compared to a simple byte-for-byte equality check.
Obviously, it can be done, but I guess Linux devs don’t consider it worthwhile.
(And yes, all modern filesystems support Unicode. Linux stores them as arbitrary bytes, Apple’s HFS uses… some special bullshit, and Windows uses UTF-16.)
so if linux stores file names as arbitrary bytes them could I modify a ext4 fs to include a / in a file name
Meanwhile fishshell:
deleted by creator
cd snuts
did you mean smuts?
This is a feature, not a bug
Right? I rather not have a computer automatically autocorrect.
Yeah, and I think most shells will correct this case by pressing tab
Also, I constantly name files in the same directory the same thing except for case. In my ~/tmp directory I have unrelated foo.c (C source) and foo.C (C++ source).
Chaotic evil
Why not .cpp for C++? I don’t use C++, but I thought that was the standard.
.C
came first. I don’t usually use it though; I usually use.cc
or.cxx
, but if I’m making some tiny test source, I often use.C
. I’m strongly opposed to the.cpp
extension because calling C++ “CPP” leads to confusion with the preexisting (before C++) use of the initialism to refer to the C preprocessor. There’s a reason why CPPFLAGS refers to preprocessor flags and CXXFLAGS refers to C++ flags.Just use
.C++
But then the filename wouldn’t be
/^[[:alnum:]._-]*~*$/
.
All folders and files should be in lower case.
Why did Linux systems go for capitals in the home folder? It’s actually kind of annoying and takes extra key presses.
…A while later “XDG Base Directory Specification”
Why does Linux do anything it does? Because a bunch of shortsighted nerds think it’s a good idea. For example, try to install software on another disk.
Any help with that?
As someone said you solution is to symlink or setup LVM volume groups for different mount points. Essentially, it’s all or nothing. You can’t just put a single program on a different disk without then taking all those files and manually symlinking them to the right place. It’s honestly one of the biggest Linux oversights.
Symlink your desired location on the target disk to the place the system thinks the software should go. (In my case, /usr/local/games is a symlink to a different drive.)
Thanks
XDG specifies the capital names, but to be nitpickingly technically precise, linux systems don’t do this. It mostly is done by the distribution maintainers, and the XDG specs. A base system does not usually have a notion of anything beyond your $HOME.
Try adding a user:
sudo adduser basicuser
. If youls -al ~basicuser
you will see it’s almost empty, just the .bashrc (or in my fedora, there’s some .mozilla crap in /etc/skel that also gets bootstrapped).
I like your style
This is completely unrelated to the meme at hand, but the title just reminded me that for a while, Merriam-Webster mistakenly included the word “Dord” to mean density - because an editor misread the entry for “D or d” as an abbreviation of density.
This is as stupid as it is funny. I love it <3
I am regularly disappointed that the word games I play on my phone don’t accept ‘dord.’ They should, damn it! One of them accepts Jedi, ffs!
echo ‘set completion-ignore-case On’ >> ~/.inputrc
also idk does zsh do this automatically? don’t think i’ve ever had this problem except on legacy AF servers
i mean… unless you don’t tab complete, but then who doesn’t spam tab 30 times every keystroke?
Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.
Awesome, thanks
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
Don’t know actually, never used a language like that. But should be easy enough to undo should one test it and end up not liking how it handles it.
Shit yo. How come I only learn this now? Thanks!
I love how many people brought up the Turkish “I” as if everyone here is on the Unicode steering committee or just got jobs for Turkish facebook.
I, an English speaker, have personally solved the problem by not having a Turkish I in the name of my Downloads directory, or any other directory that I need to cd into on my computer. I’m going to imagine the Turks solve it by painstakingly typing the correct I, or limiting their use of uppercase I’s in general.
In fact, researching the actual issue for more than 1 second seemingly shows that Unicode basically created this problem themselves because the two I’s are just seperate letters in Turkic languages. https://en.m.wikipedia.org/wiki/Dotted_and_dotless_I_in_computing
If you nerds think this is bad try doing Powershell for any amount of time. It is entirely case-insensitive.
Why the FUCK did they make characters that look the same have different codepointers in UNICODE? They should’ve done what they did in CJK and make duplicates have the same codepointer.
Unicode needs a redo.
Well letters don’t really have a single canonical shape. There are many acceptable ways of rendering each. While two letters might usually look the same, it is very possible that some shape could be acceptable for one but not the other. So, it makes sense to distinguish between them in binary representation. That allows the interpreting software to determine if it cares about the difference or not.
Also, the Unicode code tables do mention which characters look (nearly) identical, so it’s definitely possible to make a program interpret something like a Greek question mark the same as a semicolon. I guess it’s just that no one has bothered, since it’s such a rare edge case.
Why are the Latin “a” and the Cryilic “a” THE FUCKING SAME?
In cases where something looks stupid but your knowledge on it is almost zero it’s entirely possible that it’s not.
The people that maintain Unicode have put a lot of thought and effort into this. Might be helpful to research why rather than assuming you have a better way despite little knowledge of the subject.
When it’s A FUCKING SECURITY issue, I know damn well what I’m talking about.
Again you do not because the world consists of more than your interests and job description.
I know damn well what I’m talking about when someone could get scammed on “apple.com” but with a Cyrillic A.
I and l also look identical in many fonts. So you already have this problem in ascii. (To say nothing of all the non-printing characters!)
If your security relies on a person being able to tell the difference between two characters controlled by an attacker your security is bad.
The problem is when you can register “apple.com” with the Cryillic A, fooling many.
The I l issue is caused by fonts, not by ASCII.
So you type
cd D
tab and it brings you toDocuments
alias d=“cd ~/Downloads”
Use Zsh or Fish and tab completion.
Or better yet, use z or zoxide:
“z down” will fuzzy match the “~/Download” folder.This is the way!
Yeah, if that’s the only reason, changing your shell is overkill.
Never used or heard of it before but apparently zoxide is only for
cd
command, do you happen to know if there’s some fuzzy match for in general?At the moment what I do is
history foo | grep -i "bar"
I don’t get it… “D” is a complete different character than “d” is.
It’s like wondering why “file1” is not opened when I typed in “file2”.
that’s not how language works though, in human language (i know this can be confusing) d and D are the same letter just in different forms.
It’s one thing to have case sensitivity in programs doing data manipulation, that makes sense because you don’t want the program to accidentally use the wrong files without supervision.
But when you have an interactive prompt you know what you’re doing, you can see if you entered the wrong directory, and you’re generally going to be working in directories that you have yourself organized.
Doesn’t tab completion solve this if there are no alternatives with matching case? sounds like a PBKAC
You could also say that
down
should not complete todownload
since those are completely different strings and you shouldn’t expect one to get you the other.Sorry,
down
is a substring ofdownload
I don’t get your point either?Substring is not string.
If they were interchangeable, then “D” & “d” should be too.
down
matchesdown*
because*
also includes empty string. Alsodownload
matchesdown*
D
matchesD*
butd
is not matchingD*
becauseD
is a different character thand
.but why do we have to match specifically against
substr*
? it’s not a law of nature, we could also match against the regex(?i)substr(?-i).*
not saying that one option is necessarily better, but I don’t see a good reason for which any one of these options would be terrible
Because usability. If you have the files
down
down1
down2
downxyz
anddownload
and the user only knows that it was “something with down” it’s best to show the user everything matching “down*” and let the user decide what’s the correct one.Also I’m not sure but wouldn’t your expression show everything if only one character would be entered?
And again I don’t see this solving anything if the entered string actually contains other characters then what’s in the file (
D
!=d
)Yes one could argue that some form of advanced algorithm or even AI could be used to identify such use case like download and Download but this is programming Humor, not linguisic Humor.
would it not be usable to have completion be case insensitive? I seem to be able to use that… if I only remember “something with down”, I could just as easily forget the capitalization of “down”. maybe I have
downloads
andDown
? why not show everything matching case insensitively and let the user decide what’s the correct one?I didn’t really understand what you thought the regex did incorrectly, but I think the regex works fine, at least for most implementations, anyways what I meant is just a case insensitive version of the regular substring completion, which shouldn’t be too difficult to make.
The only thing it solves is the frustration of having to look for a file/directory twice because you didn’t remember it’s capitalization. again, those are different characters just like a
do
anddownloads
are different strings, but it can be easier for users if they can just press tab and let the computer fill the part of the name the don’t remember (or don’t want to type).you don’t need an advanced algorithm or and AI, there are many easy ways to make completion case insensitive (like that regex for example). Issues involving names are inherently somewhat linguistic, but either way interactive shells are meant to be (at least somewhat) usable to humans, and as seen by the post, some people would prefer completion to be case insensitive.
On Windows filenames are case insensitive at least usually, some people are used to that. But that is poor design for so many reasons, Turkish I being one of them.
Now take Android. Files are case-sensitive yet you can’t create 2 files with same name if they only vary in case.
TIL, thanks. I wonder why they chose to do it this way.
They cater to windows users that are used to the quirks of their broken system.
One of the most pointlessly annoying things I’ve had to deal with was trying to move a process made for Linux onto a Windows MINGW/cygwin-type environment where one of the scripts would generate “.filename” AND “.FileName” files. :|
People want their computers to magically know what they want these days. :)
This specific problem doesn’t exist in oh-my-zsh config though. It will find the directory even if spelling it like this.
“magically know what they want” aka occasionally set you and your files on fire
i prefer not fire
deleted by creator
There’s no place like
~
.deleted by creator
You know you prefer the D
OP can definitely handle a bigger D
Op does not know about $CDPATH and tab completion keke
I’ve seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?
I have multiple times fumbled with forgetting to capitalize something, only for the terminal to ‘dunk’ at me
For bash, this is enough:
# Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on"
If you also add e.g.
CDPATH=~/Documents
, it will also always autocomplete from your Documents no matter which directory you’re on.Thanks kind stranger. Never knew of this.
No problem!
As an aside, I see we’re bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.
Setting
CDPATH=:~/Documents/Dev
makes navigating to any of my projects so much easier.Thanks for bringing it to my attention
There’s probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things “just work”: not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don’t need any weird magic like in Bash if you want to use an alias with the same completion
Hmm, it didn’t “just work” for me. I had to set it up recently:
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
That line needs to go in .zshrc. Maybe it’s enabled by default with oh-my-zsh?
I’m sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh
I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind