Currently, Tilix supports stripping trailing space on paste. However, it is sometimes cumbersome that some trailing spaces are copied from Tilix.
Example: on copying in Tilix (and other terminal emulators that doesn't support this feature[^1]), the following result may happen ($ is marked as the end of line)
user@hostname /b/grub> ls $
fonts/ grub.cfg grubenv locale/ themes/ x86_64-efi/$
I have read some code of Tilix, and find out that it's VTE whom is responsible for copying selected texts (vte.copyClipboard() and vte.copyClipboardFormat(VteFormat.HTML)). However, there is nothing like VteFormat.TextWithoutTrailingSpace within VTE's API. So I guess this feature can only be implemented for text copying -- it sounds not like a good idea to implement this feature for "Copy as HTML". When this proposed option is on:
Get selected text with VTE's API (and strip trailing space).
Manually put it into clipboard instead of directly using vte.copyClipboard()
I'm not quite sure whether Tilix would accept this idea, and I'm also not quite familiar with D. However, if this is acceptable, I'm willing to give it a try and submit a PR if it works.
[^1]: As far as I know, Konsole and Xterm support stripping trailing space when copying.
Currently, Tilix supports stripping trailing space on paste. However, it is sometimes cumbersome that some trailing spaces are copied from Tilix.
Example: on copying in Tilix (and other terminal emulators that doesn't support this feature[^1]), the following result may happen (
$
is marked as the end of line)Instead of this:
I have read some code of Tilix, and find out that it's VTE whom is responsible for copying selected texts (
vte.copyClipboard()
andvte.copyClipboardFormat(VteFormat.HTML)
). However, there is nothing likeVteFormat.TextWithoutTrailingSpace
within VTE's API. So I guess this feature can only be implemented for text copying -- it sounds not like a good idea to implement this feature for "Copy as HTML". When this proposed option is on:vte.copyClipboard()
I'm not quite sure whether Tilix would accept this idea, and I'm also not quite familiar with D. However, if this is acceptable, I'm willing to give it a try and submit a PR if it works.
[^1]: As far as I know, Konsole and Xterm support stripping trailing space when copying.