EasyShell icon indicating copy to clipboard operation
EasyShell copied to clipboard

Don't add a new line at end of "Copy ... to clipboard"

Open Altair31 opened this issue 8 years ago • 5 comments

Hi, I'm facing a little problem with this amazing plugin, it always adds a new line at the end of the clipboard entry. So when I paste my bash script path in a console, the command is immediately run.

It will be a little (I hope) but useful enhancement to remove this trailing new line character.

OS: Centos 7.3 Eclipse Neon.3 Release (4.6.3) EasyShell: 2.1.0.v20170508-1844

Altair31 avatar Jul 21 '17 15:07 Altair31

Hi, thanks for reporting this!

You can edit the command or create new one with the needed change. Just select "Window -> Preferences -> EasyShell -> (1) Menu -> Copy Full Path to Clipboard". If you want change the behaviour of the original command use "Edit..." (for menu) and again "Edit..." (for command it self). If you want an additional entry for this case use "Copy..." (for menu) and again "Copy..." (for command it self). Now remove the ${easyshell:line_separator} from "Command:"

The original ${easyshell:resource_loc}${easyshell:line_separator}: image

will be ${easyshell:resource_loc} and you can change the name, e.g. to Full Path (no new line): image

So if you used "Copy..." then it looks like: image

You can change all or add new commands in this way!

anb0s avatar Jul 24 '17 17:07 anb0s

... Just want to give the information why i prefer using new-line or some other delimiter in all clipboard commands: I'm using them with one or more selected resources and the resources pathes are delimited by line separator. It can change if future versions if #73 is implemented and delimiter is added as own field with the option "add only if more then one resource selected"...

anb0s avatar Jul 24 '17 17:07 anb0s

Thanks, I did not see there are some preferences

Altair31 avatar Jul 25 '17 07:07 Altair31

Even if this can be configured the default setting is wrong. The command is named "Copy Full Path" and not "Copy Full path and newline". Therefore in my opinion the default newline should be removed as it is unexpected.

For me this feature is important as I want to copy a file path to clipboard and paste it into Java code string. The additional newline is really a pain.

And I don't want to manually configure this for every new Eclipse installation or workspace.

jpstotz avatar Aug 25 '23 07:08 jpstotz

I'm not using eclipse in my daily work anymore and therefore cannot allocate time for it -> any contribution is welcome.

anb0s avatar Aug 31 '23 19:08 anb0s