Not sure if this is possible at all. I have to display UNIX commands in a user manual, some of them quite long. These will not fit in a single line so they have to wrap.
To display them I tried both using the verbatim
environment and the listings
package (with breaklines set to true). However, when I go to the final PDF and double click the line, which is now wrapped, it does not select the entire command but only the single line in which I double clicked.
Imagine a command like the one below. Is there an environment I can use that allows me to double click the command in the final PDF document and have it select the entire command?
$ keytool -genkeypair -dname "cn=sub.example.com"
-alias sub_root -keyalg RSA -keysize 2048 -validity 500
-keystore sub.ks -storepass pass -storetype jks
Clarification: Currently, at least with the verbatim environment, the reader can click-and-hold and then drag to select the entire command; but when this is pasted into the terminal, the terminal reads it as several lines and that won't do. Alternatively, I can add \
at the end of each line (except last one) but then the user pastes the command and cannot edit it. Ideally, we'd have the command automatically wrapped and without back slashes, and double clicking in any line would select the entire command so we can paste it as a single editable line.