allow middle-click copy/paste from code blocks #4221

Closed
opened 2026-02-05 08:17:06 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @jschueller on GitHub (Sep 19, 2023).

Describe the feature you'd like

The Linux selection to copy text does not work on text inside code blocks.
Eveywhere else selecting some text by drag selection with the mouse sends it to the clipboard, then I can paste it using the middle-click into another editor, shell prompt or whatever.

Describe the benefits this would bring to existing BookStack users

This would be practical to cherry-pick copy lines of code, but sadly that's the only text I cannot paste.

Can the goal of this request already be achieved via other means?

It can be achieved using CTRL-C/CTRL-V with the keyboard, but I have buttery fingers :]

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

Under 3 months

Additional context

No response

Originally created by @jschueller on GitHub (Sep 19, 2023). ### Describe the feature you'd like The Linux selection to copy text does not work on text inside code blocks. Eveywhere else selecting some text by drag selection with the mouse sends it to the clipboard, then I can paste it using the middle-click into another editor, shell prompt or whatever. ### Describe the benefits this would bring to existing BookStack users This would be practical to cherry-pick copy lines of code, but sadly that's the only text I cannot paste. ### Can the goal of this request already be achieved via other means? It can be achieved using CTRL-C/CTRL-V with the keyboard, but I have buttery fingers :] ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? Under 3 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:17:06 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 19, 2023):

Hi @jschueller,
Thanks for the request.

I'm not sure this is something that's going to be simple to address though.
From what I've found, it comes down to browser support. This doesn't work for me on Firefox, but does on Chrome.
Our underlying library, codemirror, has to do a lot of it's own user selection management but Firefox does not regard scripted selection handling for this kind of clipboard system.

@ssddanbrown commented on GitHub (Sep 19, 2023): Hi @jschueller, Thanks for the request. I'm not sure this is something that's going to be simple to address though. From what I've found, it comes down to browser support. This doesn't work for me on Firefox, but does on Chrome. Our underlying library, codemirror, has to do a lot of it's own user selection management but Firefox does not regard scripted selection handling for this kind of clipboard system. - [Upstream CodeMirror issue](https://github.com/codemirror/dev/issues/1097) - [FireFox bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=1567160)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4221