Reasonable and sane behavior of cd. Just get into the habit of always using lower case names for files and directories, that's how our forefathers did it.
Even worse, many components will ignore the XDG_DOWNLOAD_DIR var so even if you manually change it to $HOME/downloads (lower-case) it will often break things.
If a directory has multiple words in it I usually do kebab case: i-like-mine-in-a-way-i-can-read-them-properly. Both easier to read and type than pascal case.
For more complex filenames I use a combination of kebab-case and snake_case, where the underscore separates portions of the file name and kebab-case the parts of those portions. E.g. movie-title_release-date-or-year_technical-specifications.mp4
No. Zsh. It's pretty easy to have a nice auto compl. No need for omz. After knowing poweline10k I just use it and syntax highlight plugin, manually installed. There is no need to add entire omz.
If you need to run a set of commands or a script with fish you can just toss them in a file and run bash file.sh. I have been daily driving fish for years and I don't even have think about it.
I personally like xonsh despite the minor amount of wonkiness it has, it's so nice to have python available directly in your shell, it takes the "i don't care about the quality of my code i just want this shit to work with minimal effort"-ness of bash and turns it up to 13.
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 to file.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 meant File.js to file.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.
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
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.)
If you did it would likely break something as it's one of only two characters not allowed in a file name (the other being null).
You can do a lot of funky stuff within the rules though, think about control characters, non-printing characters, newlines, homographs, emojis etc. and go forth and make your file system chaos!
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).
.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.
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.
I believe that type of stuff is specified in your locale, so it's possible that it would do the right thing if you've set your language to Turkish. Please try it and let us know though :)
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.
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.
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.
It would be a default on almost every distro that follows XDG specifications to have stuff like Downloads, Pictures, Videos in the $HOME folder. One of the first things I do as part of an installation is to modify ~/.config/user-dirs.dirs and set a specific folder, say /data/downloads or ~/downloads, for every XDG base directory.
yeah Fish tab completion works, but one thing I've noticed though is that tab completion for wrong case only works if there's no option with the correct case
e.g. if I have Downloads and Downloads2 then d with tab completion will become Downloads, but if I have Downloads and downloads2 it will tab complete to downloads2 and D will complete to Downloads
I've been meaning to look through the Fish documentation to see if I can change that and fuzzy search for history but never got around to it
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.
You could also say that down should not complete to download since those are completely different strings and you shouldn't expect one to get you the other.
Because usability. If you have the files downdown1down2downxyz and download 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 and Down? 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 and downloads 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.
I remember having that when I used OhMyZsh, but after going back to a more bespoke config it doesn't work anymore. Also tried using zsh as a different user to ignore my own configs, that doesn't work either.
It's not default in zsh maybe, but it's default in the oh-my-zsh config most people use.
I ran zsh for a while without that config and manually configured everything and it also works, but takes quite a bit of web searching to find all the knobs to turn.
I don't think most people use oh-my-zsh. It's very popular, and a lot of people use it, but I think most is a stretch.
Either way, it's just a set of plugins and configs so of course you can get it to work on any setup. Just saying that it's not inherent to zsh, and you can probably get similar behavior in most shells with a similar config.
Everyone on any Linux thread ever: you are a moron, obviously and you're doing it wrong. Why don't you install another distro, or better yet: modify and recompile your distro to match your desired experience, the code is open source ffs! What do you need? 4 years of work maybe? Come on.
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.
Well completion-ignore-case is enough to solve this particular problem, the other options are just sugar on top :)
I'm going to add completion-prefix-display-length to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.
For example if you have a folder with these files:
GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is ~/.inputrc and you'd enable the above mentioned options like this
$include /etc/inputrc
set completion-ignore-case on
set show-all-if-ambiguous on
set completion-map-case on
set completion-prefix-display-length 9
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
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
Honest question: is case sensitivity that important? Are there files named settings.ini and Settings.ini, for example, in the same folder that do different things?
You have to try it but I think it still works. Aliases just replaced the text you typed with text in the alias, so if you append a subfolder to the alias it should also be appended to the command.
It's like using !! when navigating folders. You can do cd ~/Downloads and then !!/source and it resolves to cd ~/Downloads/source
I'm sure that still works with aliases. Then you'll have dl/source and Doenloads/source that are the same location. Using aliases will mean any script or program you may use that might point to them won't just create a new default folder that is then no longer the same location as the renamed one that you'll expect everything in
There are two Linux paradigms that I consider stupid. One is the use of centralized software repositories managed by the distro instead of individual developer maintained installers. The other one is file system case sensibility. They already admitted defeat on the first one with the rise of containerised applications. I wonder how much longer they'll keep the charade on the second one.
Indeed, but I'm sure we can agree that it's pretty stupid for every distro to maintain its own repo. That's a lot of duplicate work, which could be spend on more useful things. Luckily flatpak is well on its way to change that
Hm... But different distros have different philosophies (not just) about updates. That's part of why people choose a specific distro.
Theres still plenty speaking against flatpak (larger sizes, problems with GTK/qt themes, and it's only meant for GUI applications - you still need a separate system for the kernel and lower-level/cli tools. And frankly, that makes flatpak unusable to me, because the purpose of a centralized package management system is not having duplicate systems).
So in short: y'all are gonna pry pacman from my cold, dead hand.
I'm not against distros as a whole, some extra work will be inevitable because people have different preferences, but it feels like a waste having a Firefox package for arch, ubuntu, fedora and Debian while essentially all being identical. Indeed flatpak isn't perfect yet, but it works great for me and it's steadily improving
Reasonable and sane behavior of
cd. Just get into the habit of always using lower case names for files and directories, that's how our forefathers did it.Yes, but this is the default on many distros, so for once the end user is not to blame
Even worse, many components will ignore the
XDG_DOWNLOAD_DIRvar so even if you manually change it to$HOME/downloads(lower-case) it will often break things.Keep filling those bugs and stop complaining on random forums, kids
Porque no los dos?
Something something symlink Downloads to downloads
Yeah but the main issue is that I don’t want there to be a
Downloadsdirectory in my home.This is all fun and games until you try moving a backup to a file system that's case-insensitive
Why not just
cd $XDG_DOWNLOAD_DIRin the first place?That's not an environment variable. It's defined in
${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs.Though you can use the
xdg-user-dir DOWNLOADcommand to get it automatically.Lower case directories?
Eww
ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly
If a directory has multiple words in it I usually do kebab case: i-like-mine-in-a-way-i-can-read-them-properly. Both easier to read and type than pascal case.
For more complex filenames I use a combination of kebab-case and snake_case, where the underscore separates portions of the file name and kebab-case the parts of those portions. E.g.
movie-title_release-date-or-year_technical-specifications.mp4CamelCase directories and snake_case files.
Do. none of you use case insensitive autocomplete? “do ” “Downloads”
Use a shell with decent auto-completion. I have not been irritated by this in years.
Won’t autocomplete fail if you do “cd d” and then try the autocomplete?
Or is that what you mean by “decent” auto-completion?
No, it will probably go to "Documents", and if you hit tab again it should go to "Downloads". (Assuming you have the normal default folders)
bash's autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean
Not with a decent autocomplete. It will look for a folder starting with a small d and if it doesn't exist it looks at a folder with a large D.
The choice of the letter d was brilliant, that's for sure. Now I'm imagining a folder with a large D.
I don't get what you mean. It doesn't matter if you write a uppercase or lowercase d
Best example I could find without being crude.
Oh my zsh?
No. Zsh. It's pretty easy to have a nice auto compl. No need for omz. After knowing poweline10k I just use it and syntax highlight plugin, manually installed. There is no need to add entire omz.
I just don't use caps when naming directories
What shell would you recommend? 🤔
I use fish which is quite nice OOTB, although if you want a posix compliant shell, zsh with some plugins is also great.
If you need to run a set of commands or a script with fish you can just toss them in a file and run
bash file.sh. I have been daily driving fish for years and I don't even have think about it.https://ohmyz.sh/
Is fucking irrelevant. Just use your package manager.
Get some anger management help.
Maybe stop trying to be a smartass.
Zsh.
Omg looks like people think omz is a shell.
I personally like xonsh despite the minor amount of wonkiness it has, it's so nice to have python available directly in your shell, it takes the "i don't care about the quality of my code i just want this shit to work with minimal effort"-ness of bash and turns it up to 13.
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.jstofile.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.jstofile.jsThis 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
If you did it would likely break something as it's one of only two characters not allowed in a file name (the other being null).
You can do a lot of funky stuff within the rules though, think about control characters, non-printing characters, newlines, homographs, emojis etc. and go forth and make your file system chaos!
Meanwhile fishshell:
cd snuts
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.
.Ccame first. I don't usually use it though; I usually use.ccor.cxx, but if I'm making some tiny test source, I often use.C. I'm strongly opposed to the.cppextension 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:]._-]*~*$/.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.
Wikipedia
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
Shit yo. How come I only learn this now? Thanks!
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
I believe that type of stuff is specified in your locale, so it's possible that it would do the right thing if you've set your language to Turkish. Please try it and let us know though :)
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.
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.
$ fuckComes in handy quite frequently.
So you type
cd Dtab and it brings you toDocumentsUse 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
cdcommand, 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"using capital letters in file/directory names on Linux :|
It's a default on some distros, unfortunately, and changing it without updating the necessary env vars will break a bunch of stuff.
It would be a default on almost every distro that follows XDG specifications to have stuff like Downloads, Pictures, Videos in the
$HOMEfolder. One of the first things I do as part of an installation is to modify~/.config/user-dirs.dirsand set a specific folder, say/data/downloadsor~/downloads, for every XDG base directory.alias d="cd ~/Downloads"
Doesn't fish basically fix this?
This is not a bug, it doesn't need to be fixed.
It's funny that you're getting down voted for telling the truth. Nothing to be subjective about either. 😅
Would hope so
You can set bash or zsh to case-insensitive tab completion as well.
Seems like poor configuration either default or not
yeah Fish tab completion works, but one thing I've noticed though is that tab completion for wrong case only works if there's no option with the correct case
e.g. if I have
DownloadsandDownloads2thendwith tab completion will becomeDownloads, but if I haveDownloadsanddownloads2it will tab complete todownloads2andDwill complete toDownloadsI've been meaning to look through the Fish documentation to see if I can change that and fuzzy search for history but never got around to it
https://github.com/ajeetdsouza/zoxide too
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
downshould not complete todownloadsince those are completely different strings and you shouldn't expect one to get you the other.Sorry,
downis a substring ofdownloadI don't get your point either?Substring is not string.
If they were interchangeable, then "D" & "d" should be too.
downmatchesdown*because*also includes empty string. Alsodownloadmatchesdown*DmatchesD*butdis not matchingD*becauseDis 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
downdown1down2downxyzanddownloadand 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
downloadsandDown? 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
doanddownloadsare 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.
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
There's no place like
~.You know you prefer the D
Use zsh and press tab
The only thing that annoys me is having to wrap wildcard expressions in quotes when using e.g. the find command.
But then it looks more correct, so it's hard to argue with.
You can escape the wildcards as an alternative.
Nice, I didn't know that. I habitually forget the closing quote so this might save me some ire
This. Except don't use zsh because this is default in every single shell
Nope. Bash (at least by default on Ubuntu) doesn't have case insensitive tab completion.
afaik there’s options you can turn on that enable it
search .inputrc and set completion-ignore-case On
Still not a default. Also it's not the same thing.
Bash never does this by default
Bash has never not had tab completion out of the box for me
Tab completion is default, but completing an uppercase word by typing a lowercase letter is not
I remember having that when I used OhMyZsh, but after going back to a more bespoke config it doesn't work anymore. Also tried using zsh as a different user to ignore my own configs, that doesn't work either.
tldr, it's not default zsh behavior.
It's not default in zsh maybe, but it's default in the oh-my-zsh config most people use.
I ran zsh for a while without that config and manually configured everything and it also works, but takes quite a bit of web searching to find all the knobs to turn.
I don't think most people use oh-my-zsh. It's very popular, and a lot of people use it, but I think most is a stretch.
Either way, it's just a set of plugins and configs so of course you can get it to work on any setup. Just saying that it's not inherent to zsh, and you can probably get similar behavior in most shells with a similar config.
OMZ and TAB gang raise up!
I seems that I have triggered something, but keep that going, it’s quality content generation. 😬
Everyone on any Linux thread ever: you are a moron, obviously and you're doing it wrong. Why don't you install another distro, or better yet: modify and recompile your distro to match your desired experience, the code is open source ffs! What do you need? 4 years of work maybe? Come on.
Anything that slightly improves UX is bloat.
True! I've got rid of my monitor a long time ago, who needs one? gshshhshshshhshbsbbs
I got rid of my whole computer a long time ago, now I just use rocks. Much less bloat.
bro that xkdc is gold
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:
If you also add e.g.
CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you're on.Setting
CDPATH=:~/Documents/Devmakes navigating to any of my projects so much easier.Thanks for bringing it to my attention
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.
Well
completion-ignore-caseis enough to solve this particular problem, the other options are just sugar on top :)I'm going to add
completion-prefix-display-lengthto these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.For example if you have a folder with these files:
FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofilesJust type
vim TABto seeGNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is
~/.inputrcand you'd enable the above mentioned options like thisThere'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
You can also disable case sensivity in bash
this seems like a recipe for disaster
Since Linux 5.2, you can disable case sensitivity on the filesystem level on ext4 (called case folding).
I wonder how many things subtly break when you enable that option.
Is this a competition for worst idea to solve the problem? :)
Is there also an option to only have 8.3 filenames? Those long names are so tiresome.
How to shoot yourself in the foot in one simple step
This is default in SteamOS.
Honest question: is case sensitivity that important? Are there files named settings.ini and Settings.ini, for example, in the same folder that do different things?
i renamed my home folders to
dl,docs,pics, etc. and use auto-cd (whatever its called) to just typedlinstead ofcd dlYou could just use aliases in your bashrc
alias dl=cd ~/DownloadsMight need quotes around the command.
sure, but what if need a subfolder of
dl, likedl/sourceor whatever. same with documents and picturesYou have to try it but I think it still works. Aliases just replaced the text you typed with text in the alias, so if you append a subfolder to the alias it should also be appended to the command.
It's like using !! when navigating folders. You can do
cd ~/Downloadsand then!!/sourceand it resolves tocd ~/Downloads/sourceI'm sure that still works with aliases. Then you'll have dl/source and Doenloads/source that are the same location. Using aliases will mean any script or program you may use that might point to them won't just create a new default folder that is then no longer the same location as the renamed one that you'll expect everything in
ok but if i open a gui file explorer, i can type
dlto go to focus downloads, anddocan match downloads or documents (or dotfiles)Oh, yeah i think i also confused them with symlinks, you could use them?
true, but then i would have duplicates of those folders in home directory
That's fair
Here's how to fix this[+]
Create
$HOME/.config/user-dirs.dirswithYou may need to logout/in for things to reread this file.
The full list of keys is:
+: Since this is Linux, this is a fix for many but not all cases.
XDG User dirs are cool, i agree. But that's not really the problem here
There are two Linux paradigms that I consider stupid. One is the use of centralized software repositories managed by the distro instead of individual developer maintained installers. The other one is file system case sensibility. They already admitted defeat on the first one with the rise of containerised applications. I wonder how much longer they'll keep the charade on the second one.
Sorry, but you're plain wrong on your first issue. Getting all your packages from one source is one of the biggest upsides of Linux.
Pretty hilarious for mac users, of all people, to complain about centralisation. Like, don't you live in a walled garden?
Indeed, but I'm sure we can agree that it's pretty stupid for every distro to maintain its own repo. That's a lot of duplicate work, which could be spend on more useful things. Luckily flatpak is well on its way to change that
Hm... But different distros have different philosophies (not just) about updates. That's part of why people choose a specific distro.
Theres still plenty speaking against flatpak (larger sizes, problems with GTK/qt themes, and it's only meant for GUI applications - you still need a separate system for the kernel and lower-level/cli tools. And frankly, that makes flatpak unusable to me, because the purpose of a centralized package management system is not having duplicate systems).
So in short: y'all are gonna pry pacman from my cold, dead hand.
The same goes for me, but with Portage, brother.
I'm not against distros as a whole, some extra work will be inevitable because people have different preferences, but it feels like a waste having a Firefox package for arch, ubuntu, fedora and Debian while essentially all being identical. Indeed flatpak isn't perfect yet, but it works great for me and it's steadily improving
Just make a downloads folder if you absolutely want to go there
Symlink
mount bind
...why is it so hard to find a picture of a mountain with a harness on it
ln -s Downloads downloads FTW
But then you're still accessing "Downloads" and not "downloads"
Don't even have to cd when using completion with fish/zsh. Just type
Zoxide and
cd down. ;)Fish baby. Fish.
Because you need to cd "path to directory" not cd "name" lol
lol
https://youtu.be/oavMtUWDBTM?si=0L2KD8y5Pl_nBt_U
Here is an alternative Piped link(s):
https://youtu.be/oavMtUWDBTM?si=0L2KD8y5Pl_nBt_U
Piped is a privacy-respecting open-source alternative frontend to YouTube.
I'm open-source; check me out at GitHub.
Or use a nicer alternative like zoxide! :)
Or Windows ;)
"tab"