Login
You're viewing the front-end.social public feed.
  • May 4, 2026, 4:01 PM

    GitHub/screen reader users, how do you copy a link to a code snippet accessibly? The way I just got it done wasn't that great, and apropos of nothing I'm about 5 seconds away from having a fucking aneurysm. Please tell me there's a nice accessible workflow that I missed.

    💬 2🔄 1⭐ 0

Replies

  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • May 4, 2026, 4:30 PM

    @Scott Ah. Yeah no idea, sorry.

    The intent behind the code on a file's page being a focusable, read-only edit field was to accommodate use cases like this. I.e. you were supposed to be able to select lines in the standard Shift-Arrow-y way, then open a context menu or use keyboard shortcuts. I guess they gave up before doing any of that.

    💬 2🔄 0⭐ 0
  • May 4, 2026, 5:02 PM

    @jscholes They got some of it done. You can select code in a shifty arrowy way, you can indeed load a context menu with expected keystrokes, but that context menu doesn't contain the kebab icon button that gets to the copy permalink option I wanted. Nearest thing in the context menu I could get is copy the selected code itself. Annoyingly once I gave up and got sighted help to do the clickerty first line, hold shift and last line parts, the kebab button appears right at the bottom of the page with a nice label and its menu is usable. No idea how to get that to happen without a mouse though, by the time I got that far I was too pissed off to keep fiddling.

    💬 0🔄 0⭐ 0
  • May 4, 2026, 5:33 PM

    @jscholes @Scott So, I just got this to work by doing the following, on Mac right now so do the NVDA equivllent. Go into the editor for the file, select the lines in focus mode, then switch to browse mode and look below the text field. At least when I moved away with VoiceOver I saw a "line 1 options" button, always saying line 1 regardless of what range I actually had. If it doesn't show up the mouse location might be a factor because i had the mouse rooted while trying other things. Anyway copy permalink is there.

    While doing all of this I somehow got a message to pop up saying to press Option+F1 for additional keyboard shortcuts, I guess that would be Alt+F1. That list implied Option+Shift+C should have gotten me that menu too, but it didn’t, instead it was trying to type over it which failed because I was in a read-only view. This could be either because this types a character in Polish, Safari being Safari or the command just being not implemented, idk. Anyway try one of these things and maybe if the stars align it'll work?

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • May 4, 2026, 5:55 PM

    @jscholes @pitermach Oooh got the button to appear once here, with a correct line label as well. Can't get it to happen again. Commiting Alt+Shift+C to memory. Thanks!

    💬 0🔄 0⭐ 0
  • May 4, 2026, 5:00 PM

    @Scott Unfortunately I also haven't found an (accessible) way to do that properly. So what I'm doing is, given that my branch is up-to-date with the remote, to look up the exact line numbers in my editor and then append them to the URL I want to send to someone in the style #L15-L45. The full URL would then look like the following example: github.com/GStoob/commandline-. Hope this helps.

    💬 2🔄 0⭐ 0
  • May 4, 2026, 5:04 PM

    @gianluca_stoob Yep thanks, in the end I got it done once, have harvested that URl and I guess I'll just keep adding line numbers to it the same way. Annoying though!

    💬 0🔄 0⭐ 0
  • May 4, 2026, 5:57 PM

    @gianluca_stoob Yo, in case you didn't catch it, a couple of folks in another reply thread just figured out you can Shift+Arrow to select code then hit Alt+Shift+C to get a context menu.

    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0