There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

newIdentity , in D or d come on

Use Zsh or Fish and tab completion.

janAkali ,

Or better yet, use z or zoxide:
“z down” will fuzzy match the “~/Download” folder.

words_number ,

This is the way!

seitanic ,
@seitanic@lemmy.sdf.org avatar

Yeah, if that’s the only reason, changing your shell is overkill.

Astaroth ,

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”

krey , in D or d come on

If you want to keep case sensitive completion, you can symlink it. It’s your home dir. Make yourself comfortable.

Morphit ,
@Morphit@feddit.uk avatar

There’s no place like ~.

MerfMerf , in D or d come on
@MerfMerf@feddit.nu avatar

echo ‘set completion-ignore-case On’ >> ~/.inputrc

PupBiru ,
@PupBiru@kbin.social avatar

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?

MerfMerf ,
@MerfMerf@feddit.nu avatar

Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.

jmcs ,

How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.

MerfMerf ,
@MerfMerf@feddit.nu avatar

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.

kattfisk ,

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 :)

tostiman ,
@tostiman@sh.itjust.works avatar

Awesome, thanks

UFODivebomb ,

Shit yo. How come I only learn this now? Thanks!

Feyter , in D or d come on

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”.

1984 ,
@1984@lemmy.today avatar

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.

PupBiru ,
@PupBiru@kbin.social avatar

“magically know what they want” aka occasionally set you and your files on fire

i prefer not fire

schnurrito ,

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 ,
@user224@lemmy.sdf.org avatar

Now take Android. Files are case-sensitive yet you can’t create 2 files with same name if they only vary in case.

Reil ,

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. :|

lemmonade ,

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.

Feyter ,

Sorry, down is a substring of download I don’t get your point either?

Honytawk ,

Substring is not string.

If they were interchangeable, then “D” & “d” should be too.

Feyter ,

down matches down* because * also includes empty string. Also download matches down*

D matches D* but d is not matching D* because D is a different character than d.

lemmonade , (edited )

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

Feyter ,

Because usability. If you have the files down down1 down2 downxyz 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.

lemmonade ,

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.

Swedneck ,
@Swedneck@discuss.tchncs.de avatar

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 ,

Doesn’t tab completion solve this if there are no alternatives with matching case? sounds like a PBKAC

TetrisIQ , in D or d come on

You can also disable case sensivity in bash

MooseBoys ,

this seems like a recipe for disaster

rtxn ,

Since Linux 5.2, you can disable case sensitivity on the filesystem level on ext4 (called case folding).

MooseBoys ,

I wonder how many things subtly break when you enable that option.

Dizzar ,

How to shoot yourself in the foot in one simple step

1984 ,
@1984@lemmy.today avatar

Is this a competition for worst idea to solve the problem? :)

AnUnusualRelic ,
@AnUnusualRelic@lemmy.world avatar

Is there also an option to only have 8.3 filenames? Those long names are so tiresome.

xeekei ,

This is default in SteamOS.

tigerjerusalem ,

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?

genfood OP , in D or d come on

I seems that I have triggered something, but keep that going, it’s quality content generation. 😬

drolex ,

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.

GCostanzaStepOnMe ,

Anything that slightly improves UX is bloat.

drolex ,

True! I’ve got rid of my monitor a long time ago, who needs one? gshshhshshshhshbsbbs

gnutrino ,

I got rid of my whole computer a long time ago, now I just use rocks. Much less bloat.

quantenzitrone ,

bro that xkdc is gold

Sh1nyM3t4l4ss , in D or d come on

Use a shell with decent auto-completion. I have not been irritated by this in years.

nogooduser ,

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 ,

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 ,

bash’s autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean

newIdentity ,

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.

pgp ,

The choice of the letter d was brilliant, that’s for sure. Now I’m imagining a folder with a large D.

newIdentity ,

I don’t get what you mean. It doesn’t matter if you write a uppercase or lowercase d

pgp ,
Skimmer ,

What shell would you recommend? 🤔

Sh1nyM3t4l4ss ,

I use fish which is quite nice OOTB, although if you want a posix compliant shell, zsh with some plugins is also great.

ayaya ,
@ayaya@lemdro.id avatar

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.

stevehobbes ,
yum13241 ,

Is fucking irrelevant. Just use your package manager.

stevehobbes ,

Get some anger management help.

yum13241 ,

Maybe stop trying to be a smartass.

Swedneck ,
@Swedneck@discuss.tchncs.de avatar

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.

wviana ,

Zsh.

Omg looks like people think omz is a shell.

Zaphod ,

Oh my zsh?

wviana ,

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 ,

I just don’t use caps when naming directories

Damage , in D or d come on

Use zsh and press tab

BeanCounter ,

zsh is so much nicer to work with

killeronthecorner ,
@killeronthecorner@lemmy.world avatar

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.

toynbee ,

You can escape the wildcards as an alternative.

killeronthecorner ,
@killeronthecorner@lemmy.world avatar

Nice, I didn’t know that. I habitually forget the closing quote so this might save me some ire

HurgletOfficial ,

Bloat

bdonvr ,

Just uninstall bash after

funkajunk ,
@funkajunk@lemm.ee avatar

Everyone’s playing checkers while my man’s playing chess

funkajunk ,
@funkajunk@lemm.ee avatar

Everyone’s playing checkers while my man’s playing chess

HurgletOfficial ,

No thanks, Ash/Dash is all I need

mojo ,

This. Except don’t use zsh because this is default in every single shell

chris ,
@chris@l.roofo.cc avatar

Nope. Bash (at least by default on Ubuntu) doesn’t have case insensitive tab completion.

PupBiru ,
@PupBiru@kbin.social avatar

afaik there’s options you can turn on that enable it

search .inputrc and set completion-ignore-case On

newIdentity ,

Still not a default. Also it’s not the same thing.

Damage ,

Bash never does this by default

mojo ,

Bash has never not had tab completion out of the box for me

Damage ,

Tab completion is default, but completing an uppercase word by typing a lowercase letter is not

aleq ,
@aleq@lemmy.world avatar

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.

1984 ,
@1984@lemmy.today avatar

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.

aleq ,
@aleq@lemmy.world avatar

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.

Templa ,

I can’t relate to this issue at all exactly because I use zsh. Also a little bit related but the fuck

SorteKanin , in D or d come on
@SorteKanin@feddit.dk avatar

Or use a nicer alternative like zoxide! :)

Slartibartfass ,

Or Windows ;)

Luvon , in D or d come on

cd dow *tab

aleq , in D or d come on
@aleq@lemmy.world avatar

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 ,

Yes, but this is the default on many distros, so for once the end user is not to blame

MooseBoys ,

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.

Synthead ,

Keep filling those bugs and stop complaining on random forums, kids

FiskFisk33 ,

Porque no los dos?

schnurrito ,

Something something symlink Downloads to downloads

MooseBoys ,

Yeah but the main issue is that I don’t want there to be a Downloads directory in my home.

Number358 ,

ln -s ~/Downloads ~/downloads

paperplane ,

This is all fun and games until you try moving a backup to a file system that’s case-insensitive

zlatko ,

Why not just cd $XDG_DOWNLOAD_DIR in the first place?

joyjoy ,

That’s not an environment variable. It’s defined in ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs.

Though you can use the https://man.archlinux.org/man/xdg-user-dir.1.en command to get it automatically.

Honytawk ,

Lower case directories?

Eww

ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly

aleq ,
@aleq@lemmy.world avatar

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

jasory ,

CamelCase directories and snake_case files.

eek2121 ,

Do. none of you use case insensitive autocomplete? “do ” “Downloads”

ayushnix , in D or d come on
@ayushnix@lemmy.sdf.org avatar

using capital letters in file/directory names on Linux :|

jonne ,

It’s a default on some distros, unfortunately, and changing it without updating the necessary env vars will break a bunch of stuff.

BeanCounter ,

Doesn’t Ubuntu do this? I use Ubuntu inside WSL and it bugged me so fucking much

ayushnix ,
@ayushnix@lemmy.sdf.org avatar

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.

Uncle_Iroh , in D or d come on

Because you need to cd “path to directory” not cd “name” lol

genfood OP ,

lol

coffeebiscuit ,
Rheios , in "how good are you?"
@Rheios@ttrpg.network avatar

Ah, the good ol’ “I’m not, but actually am, but not enough that I should get a raise, but I really would like one and less work hours, but I really need to stay longer because I’m so slow at everything I do and am terrible at focusing so I should really be working harder to give you your money’s worth, but you’re probably not paying me as much as you should be for that work in hindsight” theoretical with yourself and your imagined boss.

tuna_casserole ,

Wow that’s… exact.

ipkpjersi , in "how good are you?"

That couldn’t be any more accurate lmao I literally swing back and forth between dunning-kruger effect and imposter syndrome. It’s actually wild.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines