-4

This question keeps coming up every here at meta and it gets positive responses.
Yet it has not been implemented yet.
Why?!

Using a phone and copy pasting a code block is a true nightmare!
Sometimes it can take minutes to make sure you select the correct text.
Try to copy paste an array with multiple dimensions and several layers, it's just not user friendly at all.

I understand some people think "this will encourage copy pasting answers".
Maybe. Yes it will be easier, but if you really want to copy paste an answer is this the "thing" that makes them give up? No, I don't think so.

It's hard to copy the code blocks from any platform in my opinion, but especially the smaller the screen is.
Because of that, if it at least can be implement to mobile devices then I will be happy.

Other threads from the past:
2009 Shortcut or button for copying posted code from Stack Overflow
2014 Select All / Copy All Button for Code
2017 Copy button for code blocks

Video of it:
Go to 1:30
https://youtu.be/U6SfRPwTKqo

With phones being used more and more this problem is "worse" than back then (maybe not 2017).

This question was written on a phone

6
  • 4
    ...why are you copying code on a phone?
    – Makoto
    Commented Oct 13, 2018 at 5:22
  • 1
    To write answers. I post most of my answers from my phone
    – Andreas
    Commented Oct 13, 2018 at 5:23
  • @jhpratt what??? If you want to copy the OPs code with some arrays and stuff to use that on your own computer/phone to run it and correct the code. How is that a duplicate? What are you talking about?
    – Andreas
    Commented Oct 13, 2018 at 6:28
  • 1
    It is a minefield, maybe just about now is the right time to reconsider it. Commented Oct 13, 2018 at 7:44
  • @HansPassant sorry not following what you are saying with that link. If it's about it being complex to build, then in the 2014 thread there is a link to this: github.com/MrMino/StackOverflowCtrlC but that won't work on phones if I understand it correctly. And with my link I mean, code exist that does it.
    – Andreas
    Commented Oct 13, 2018 at 8:21
  • I've asked this question on Unix/Linux stack exchange and there the comment was that I should be more general (and go here). I must admit that there the feature would be more defendable. But here it receives a lot of negative attention: Why? I can understand why you're not in favor of the feature but can someone explain why this get downvoted? How can you be against a feature like that?
    – SandTh
    Commented Aug 28, 2021 at 10:03

3 Answers 3

6

This feature should have been implemented much earlier, as we can see from the linked meta discussion above from 2014 or even 2009.

It's not only about phone. Even on a computer, I always need to drag the mouse multiple times to correctly select the code area, it's very cumbersome. This also affects users who merely browse the site, since user often needs to copy the code in answer to verify on their own machine.

Manually selecting code area is way too inconvenient. This simple feature would be a much better and useful UI improvement than some fancy layout change that happened recently.

1
  • 2
    Agree! It is really a pain in the.... to copy from code blocks. Stack overflow: great content but impossible to use. how about that for a slogan?
    – Andreas
    Commented Oct 13, 2018 at 8:17
-2

If I were to wager a guess...this feature's not implemented because the people who would primarily benefit from it (e.g. users who post answers on phones) are a much smaller demographic in general.

The larger demographic has an existing work around in that they can simply select all of the text they want and copy that using their keyboard.

I could at least see rationale for wanting to do this, but I don't personally see it being worth the dev time.

7
  • 1
    Did you see the YouTube video I edited in a minute ago?
    – Andreas
    Commented Oct 13, 2018 at 5:38
  • 4
    @Andreas: No. Didn't think you needed a YouTube video to discuss a feature that's been discussed. You don't do a very decent job of selling it as a "problem". I would encourage you to start there.
    – Makoto
    Commented Oct 13, 2018 at 5:44
  • 1
    Then go watch it and you will understand.
    – Andreas
    Commented Oct 13, 2018 at 6:07
  • Have you watched the video yet? I believe it shows clearly the problem with stack overflow code blocks.
    – Andreas
    Commented Oct 13, 2018 at 9:12
  • 1
    I genially fail to understand how such a simple and useful feature gets this much negative attention... -12!!! Man, if you go on any linux/programming site this feature is there since ages... I can understand that you're not in favor of the feature but why be negative about it???
    – SandTh
    Commented Aug 28, 2021 at 9:55
  • 1
    @Bamboomy what is even more amazing is that all the other threads I linked to got positive scores with the same question/feature request. But because some very narrow minded chooses to be negative and not do the research of the issue then you get this comedy of answers.
    – Andreas
    Commented Aug 28, 2021 at 21:19
  • @Andreas: maybe because of that it gets down voted here... I really hope that is the reason. In any case it remains a mystery that a simple request that is documented on their own site and is nothing more than adding a little JavaScript (so no extra load on the server or something like that) doesn't get implemented...
    – SandTh
    Commented Aug 29, 2021 at 8:11
-2

I don't get the scenario you have in mind. You said you feel the urge of this feature because you want:

To write answers. I post most of my answers from my phone

Odds are that you want to quote a snippet from the whole code and you have to select it anyways before copying; if you want a button to copy the entire code i don't see how it can be any useful while answering since you will paste the whole block and then modify it through answer window which is as well time consuming. I can't see honestly any scenario where this feature can be useful on phone. Even on desktop it's not worth implementing it since questions contain 99% of the times custom lines of code and also 99% of the times you have custom code to add. So at the end it's faster to write it down maybe copying unusually long lines with the help of keyboard shortcuts.

1
  • 2
    There are many reasons why you need to copy the full code block. For example, the code block is only an array/Json. I can't copy half of a Json and expect it to work. Most of the time you need to run the code yourself in order to debug the code. For that you need all the code, and that means select all and copy
    – Andreas
    Commented Oct 13, 2018 at 9:11

Not the answer you're looking for? Browse other questions tagged .