- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
So you type
cd D
tab and it brings you toDocuments
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”.
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.
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
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.
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. :|
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.
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
echo ‘set completion-ignore-case On’ >> ~/.inputrc
Awesome, thanks
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.
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.
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 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 :)
Or use a nicer alternative like zoxide! :)
Or Windows ;)
Use a shell with decent auto-completion. I have not been irritated by this in years.
What shell would you recommend? 🤔
Zsh.
Omg looks like people think omz is a shell.
Is fucking irrelevant. Just use your package manager.
Get some anger management help.
Maybe stop trying to be a smartass.
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 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.
I just don’t use caps when naming directories
Won’t autocomplete fail if you do “cd d” and then try the autocomplete?
Or is that what you mean by “decent” auto-completion?
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
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
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.
Zoxide and
cd down
. ;)Here’s how to fix this[+]
Create
$HOME/.config/user-dirs.dirs
withXDG_DOWNLOAD_DIR=“$HOME/downloads”
You may need to logout/in for things to reread this file.
The full list of keys is:
- XDG_DESKTOP_DIR
- XDG_DOWNLOAD_DIR
- XDG_TEMPLATES_DIR
- XDG_PUBLICSHARE_DIR
- XDG_DOCUMENTS_DIR
- XDG_MUSIC_DIR
- XDG_PICTURES_DIR
- XDG_VIDEOS_DIR
+: 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.
I have a third one for you. Not being able to pick where things install. Everything installs to the os disk. Terrible idea.
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
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
“tab”
You know you prefer the D
OP can definitely handle a bigger D
Don’t even have to cd when using completion with fish/zsh. Just type
down[tab]
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.
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.
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.
Doesn’t fish basically fix this?
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
andDownloads2
thend
with tab completion will becomeDownloads
, but if I haveDownloads
anddownloads2
it will tab complete todownloads2
andD
will complete toDownloads
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
This is not a bug, it doesn’t need to be fixed.
Would hope so
There are solid technical reasons whenever someone’s computer doesn’t work the way they expect.
They don’t matter.
The software can do what people want, or it can be wrong.
Wrong, it does matter. Just because it’s not working as you want, doesn’t mean it’s not working as expected.
It literally does.
It’s funny that you’re getting down voted for telling the truth. Nothing to be subjective about either. 😅
You can set bash or zsh to case-insensitive tab completion as well.
Seems like poor configuration either default or not