You’ve come from Windows and have brought dangerous expectations.
D or d come on
Submitted 8 months ago by genfood@feddit.de to programmer_humor@programming.dev
https://i.imgur.com/NDuJIA2.jpg
Comments
MonkderZweite@feddit.ch 8 months ago
naught@sh.itjust.works 8 months ago
MacOS has a case insensitive file system. It causes me untold grief
sysadmin420@lemmy.world 8 months ago
Is a 40 year old it guy, wat
Macos is case insensitive?!
Honytawk@lemmy.zip 8 months ago
Why would case sensitive path names be considered dangerous?
colonial@lemmy.world 8 months ago
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.
(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.)
Sh1nyM3t4l4ss@lemmy.world 8 months ago
Use a shell with decent auto-completion. I have not been irritated by this in years.
nogooduser@lemmy.world 8 months ago
Won’t autocomplete fail if you do “cd d” and then try the autocomplete?
Or is that what you mean by “decent” auto-completion?
bdonvr@thelemmy.club 8 months ago
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)
rasensprenger@feddit.de 8 months ago
bash’s autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean
newIdentity@sh.itjust.works 8 months ago
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.
Zaphod@discuss.tchncs.de 8 months ago
Oh my zsh?
wviana@lemmy.eco.br 8 months ago
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.
lightnsfw@reddthat.com 8 months ago
I just don’t use caps when naming directories
Skimmer@lemmy.zip 8 months ago
What shell would you recommend? 🤔
Sh1nyM3t4l4ss@lemmy.world 8 months ago
I use fish which is quite nice OOTB, although if you want a posix compliant shell, zsh with some plugins is also great.
wviana@lemmy.eco.br 8 months ago
Zsh.
Omg looks like people think omz is a shell.
Swedneck@discuss.tchncs.de 8 months ago
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.
Asswaterpirate@lemmy.world 8 months ago
cd snuts
zlatko@programming.dev 8 months ago
did you mean smuts?
SnowdenHeroOfOurTime@unilem.org 8 months ago
This is a feature, not a bug
Potatos_are_not_friends@lemmy.world 8 months ago
Right? I rather not have a computer automatically autocorrect.
shotgun_crab@lemmy.world 8 months ago
Yeah, and I think most shells will correct this case by pressing tab
AffineConnection@lemmy.world 8 months ago
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).
MJBrune@beehaw.org 8 months ago
All folders and files should be in lower case.
bier@feddit.nl 8 months ago
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”
UFODivebomb@programming.dev 8 months ago
I like you style
HatFunction@lemmy.world 8 months ago
FreshLight@sh.itjust.works 8 months ago
This is as stupid as it is funny. I love it <3
FlyingSquid@lemmy.world 8 months ago
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!
MerfMerf@feddit.nu 8 months ago
echo ‘set completion-ignore-case On’ >> ~/.inputrc
PupBiru@kbin.social 8 months ago
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 ever keystroke?
MerfMerf@feddit.nu 8 months ago
Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.
UFODivebomb@programming.dev 8 months ago
Shit yo. How come I only learn this now? Thanks!
tostiman@sh.itjust.works 8 months ago
Awesome, thanks
jmcs@discuss.tchncs.de 8 months ago
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
kattfisk@lemmy.dbzer0.com 8 months ago
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 :)
MerfMerf@feddit.nu 8 months ago
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.
Feyter@programming.dev 8 months ago
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”.
Swedneck@discuss.tchncs.de 8 months ago
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.
4am@lemm.ee 8 months ago
Doesn’t tab completion solve this if there are no alternatives with matching case? sounds like a PBKAC
lemmonade@lemm.ee 8 months ago
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.Feyter@programming.dev 8 months ago
Sorry,
down
is a substring ofdownload
I don’t get your point either?
schnurrito@discuss.tchncs.de 8 months ago
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.
user224@lemmy.sdf.org 8 months ago
Now take Android. Files are case-sensitive yet you can’t create 2 files with same name if they only vary in case.
1984@lemmy.today 8 months ago
People want their computers to magically know what they want these days. :)
PupBiru@kbin.social 8 months ago
“magically know what they want” aka occasionally set you and your files on fire
i prefer not fire
CodexArcanum@lemmy.world 8 months ago
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 uppercsse 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. …wikipedia.org/…/Dotted_and_dotless_I_in_computin…
If you nerds think this is bad try doing Powershell for any amount of time. It is entirely case-insensitive.
yum13241@lemm.ee 8 months ago
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.
Tranus@programming.dev 8 months ago
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.
ayushnix@lemmy.sdf.org 8 months ago
using capital letters in file/directory names on Linux :|
jonne@infosec.pub 8 months ago
It’s a default on some distros, unfortunately.
BeanCounter@sh.itjust.works 8 months ago
Doesn’t Ubuntu do this? I use Ubuntu inside WSL and it bugged me so fucking much
ayushnix@lemmy.sdf.org 8 months ago
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.
pchem@feddit.de 8 months ago
$ fuck
Comes in handy quite frequently.
starman@programming.dev 8 months ago
So you type
cd D
and it brings you to `Documentscatlover@sh.itjust.works 8 months ago
alias d=“cd ~/Downloads”
newIdentity@sh.itjust.works 8 months ago
Use Zsh or Fish
janAkali@lemmy.one 8 months ago
Or better yet, use z or zoxide:
“z down” will fuzzy match the “~/Download” folder.words_number@programming.dev 8 months ago
This is the way!
Astaroth@lemm.ee 8 months ago
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”
seitanic@lemmy.sdf.org 8 months ago
Yeah, if that’s the only reason, changing your shell is overkill.
muntedcrocodile@lemmy.world 8 months ago
Doesn’t fish basically fix this?
pgp@sh.itjust.works 8 months ago
This is not a bug, it doesn’t need to be fixed.
avonarret1@programming.dev 8 months ago
It’s funny that you’re getting down voted for telling the truth. Nothing to be subjective about either. 😅
xoggy@programming.dev 8 months ago
You can set bash or zsh to case-insensitive tab completion as well.
Astaroth@lemm.ee 8 months ago
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
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
d_k_bo@feddit.de 8 months ago
Damage@slrpnk.net 8 months ago
Use zsh and press tab
BeanCounter@sh.itjust.works 8 months ago
zsh is so much nicer to work with
mojo@lemm.ee 8 months ago
This. Except don’t use zsh because this is default in every single shell
onlinepersona@programming.dev 8 months ago
ram@feddit.nl 8 months ago
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.
willya@lemmyf.uk 8 months ago
You know you prefer the D
krey@sh.itjust.works 8 months ago
If you want to keep case sensitive completion, you can symlink it. It’s your home dir. Make yourself comfortable.
genfood@feddit.de 8 months ago
I seems that I have triggered something, but keep that going, it’s quality content generation. 😬
xnasero@programming.dev 8 months ago
Op does not know about $CDPATH keke
WindowsEnjoyer@sh.itjust.works 8 months ago
OMZ and TAB gang raise up!
darcy@sh.itjust.works 8 months ago
i renamed my home folders to
dl
,docs
,pics
, etc. and use auto-cd (whatever its called) to just typedl
instead ofcd dl
Kanda@reddthat.com 8 months ago
Just make a downloads folder if you absolutely want to go there
steltek@lemm.ee 8 months ago
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.
TetrisIQ@lemmy.world 8 months ago
You can also disable case sensivity in bash
Luvon@beehaw.org 8 months ago
cd dow *tab
lfromanini@feddit.nl 8 months ago
Zoxide and
cd down
. ;)boyi@lemmy.sdf.org 8 months ago
Don’t even have to cd. I use completion with fish/zsh. Just
down[tab]
aleq@lemmy.world 8 months ago
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.drolex@sopuli.xyz 8 months ago
Yes, but this is the default on many distros, so for once the end user is not to blame
MooseBoys@lemmy.world 8 months ago
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.Honytawk@lemmy.zip 8 months ago
Lower case directories?
Eww
ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly
aleq@lemmy.world 8 months ago
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
eek2121@lemmy.world 8 months ago
Do. none of you use case insensitive autocomplete? “do ” “Downloads”