• aleq@lemmy.world
    link
    fedilink
    arrow-up
    126
    arrow-down
    7
    ·
    1 year 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
      link
      fedilink
      arrow-up
      89
      ·
      1 year ago

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

    • Honytawk@lemmy.zip
      link
      fedilink
      arrow-up
      8
      arrow-down
      2
      ·
      1 year ago

      Lower case directories?

      Eww

      ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly

      • aleq@lemmy.world
        link
        fedilink
        arrow-up
        14
        ·
        1 year 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

  • HatFunction@lemmy.world
    link
    fedilink
    arrow-up
    56
    ·
    edit-2
    1 year ago

    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

    • PupBiru@kbin.social
      link
      fedilink
      arrow-up
      15
      ·
      edit-2
      1 year 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 every keystroke?

      • MerfMerf@feddit.nu
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

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

    • jmcs@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      ·
      1 year 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
        link
        fedilink
        arrow-up
        1
        ·
        1 year 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
        link
        fedilink
        arrow-up
        1
        ·
        1 year 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.

  • Codex@lemmy.world
    link
    fedilink
    arrow-up
    35
    arrow-down
    2
    ·
    edit-2
    1 year 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 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.

    • yum13241@lemm.ee
      link
      fedilink
      arrow-up
      13
      arrow-down
      4
      ·
      1 year 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.

      • Trantarius@programming.dev
        link
        fedilink
        arrow-up
        31
        ·
        1 year 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.

        • yum13241@lemm.ee
          link
          fedilink
          arrow-up
          2
          arrow-down
          7
          ·
          1 year ago

          Why are the Latin “a” and the Cryilic “a” THE FUCKING SAME?

          • mrpants@midwest.social
            link
            fedilink
            English
            arrow-up
            21
            ·
            1 year ago

            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.

            • yum13241@lemm.ee
              link
              fedilink
              arrow-up
              2
              arrow-down
              15
              ·
              1 year ago

              When it’s A FUCKING SECURITY issue, I know damn well what I’m talking about.

                • yum13241@lemm.ee
                  link
                  fedilink
                  arrow-up
                  1
                  arrow-down
                  2
                  ·
                  1 year ago

                  I know damn well what I’m talking about when someone could get scammed on “apple.com” but with a Cyrillic A.

              • kattfisk@lemmy.dbzer0.com
                link
                fedilink
                arrow-up
                2
                ·
                1 year ago

                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.

                • yum13241@lemm.ee
                  link
                  fedilink
                  arrow-up
                  1
                  arrow-down
                  1
                  ·
                  1 year ago

                  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.

    • jonne@infosec.pub
      link
      fedilink
      arrow-up
      40
      ·
      edit-2
      1 year ago

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

      • ayushnix@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year 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.

  • Feyter@programming.devM
    link
    fedilink
    arrow-up
    42
    arrow-down
    16
    ·
    1 year 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
      link
      fedilink
      arrow-up
      24
      arrow-down
      3
      ·
      1 year 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
        link
        fedilink
        arrow-up
        5
        arrow-down
        4
        ·
        1 year ago

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

    • lemmonade@lemm.ee
      link
      fedilink
      arrow-up
      11
      arrow-down
      2
      ·
      1 year ago

      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.

        • Honytawk@lemmy.zip
          link
          fedilink
          arrow-up
          6
          arrow-down
          2
          ·
          1 year ago

          Substring is not string.

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

          • Feyter@programming.devM
            link
            fedilink
            arrow-up
            2
            ·
            1 year ago

            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@lemm.ee
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              1 year ago

              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@programming.devM
                link
                fedilink
                arrow-up
                1
                ·
                edit-2
                1 year ago

                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@lemm.ee
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  1 year ago

                  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.

    • schnurrito@discuss.tchncs.de
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      1 year 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.

        • Reil@beehaw.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

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

    • 1984@lemmy.today
      link
      fedilink
      arrow-up
      6
      arrow-down
      7
      ·
      edit-2
      1 year ago

      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@kbin.social
        link
        fedilink
        arrow-up
        8
        arrow-down
        3
        ·
        1 year ago

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

        i prefer not fire