hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Stop adding extra spaces on copy/paste

Open crispossa opened this issue 10 years ago • 42 comments

Hi folks.

I'm trying to copy/paste my id_rsa.pub and when I paste it to a text file, I get one extra space for every new line.

Thx.

crispossa avatar Aug 24 '16 15:08 crispossa

@crispossa Can you paste the exemple ? Screenshot

ppot avatar Sep 17 '16 04:09 ppot

@ppot I'll not post my id_rsa.pub file here.

Just follow the steps:

1 - cat ~/.ssh/id_rsa.pub 2 - manually select the lines of the output 3 - paste in some text editor and see that are one space after every new line.

Thx.

crispossa avatar Sep 19 '16 15:09 crispossa

@crispossa Tested and working like a charm for me... need a picture from your part as example. I can't reproduce.

ppot avatar Sep 24 '16 22:09 ppot

Same here. No extra spaces 🤔

matheuss avatar Sep 24 '16 22:09 matheuss

I can confirm this happens for me as well, it is important to note that I am using windows. Were I to take a shot in the dark, there is probably something funky going from windows line endings to hyper.

shortjared avatar Mar 17 '17 21:03 shortjared

Can confirm this happens as well on Windows 10 Build 15063 with Hyper 1.3.1. Copying and pasting any text into nano or vim results in a newline being added for each line of copied text. In the case of vim, :set paste doesn't do anything either.

copiedtext nano vim

rohithmohan avatar Apr 19 '17 16:04 rohithmohan

Yup, I have the same issue. Windows 10 Build 14393 on Hyper 1.3.1

danjohnson95 avatar May 08 '17 10:05 danjohnson95

Can't reproduce with W10 Pro 14393 on Hyper 1.3.1 ☹️

wopian avatar May 08 '17 11:05 wopian

i can reproduce, copy pastes are weird. last w10 / last hyper.

neolectron avatar Jun 07 '17 09:06 neolectron

Same here. Hyper 1.3.3 with Windows Creator Update. I get double spacing whenever I paste anywhere in Hyper. Don't have the issue with the stock WSL Bash or other emulators like ConEmu. Probably a line endings thing as already mentioned.

unleashit avatar Jun 16 '17 20:06 unleashit

Confirmed with Windows 10 1703(15063). Not a huge problem but it does get a bit annoying sometimes.

wenlilearn avatar Aug 05 '17 16:08 wenlilearn

Confirmed with Windows 10/WSL Bash as well. This will happen if you copy anything from most UI like chrome/notepad etc.

If im not wrong, the issue is because of CRLF/LF differences between windows and unix systems, for some reason, hyper will produce two line breaks for CRLF and one for LF.

Short term solution would be to copy the text to another text editor like vscode with LF enabled (annoying) and copy it to hyper again

heyanger avatar Aug 25 '17 09:08 heyanger

Hi. Same here with Windows 10/WSL.

But I fixed this putting set ff=unix in my /etc/vim/vimrc.

Edit: My reference: http://vim.wikia.com/wiki/File_format

diegoos avatar Sep 01 '17 00:09 diegoos

I also have this issue: Windows 10-1703 Build 15063.540 with Hyper 1.4.2

alexjmoore avatar Sep 04 '17 12:09 alexjmoore

Still present in Hyper 1.4.4.

Not sure why this is marked as can't reproduce...for me it happens on any multi-line paste on windows.

alexjmoore avatar Sep 13 '17 22:09 alexjmoore

Still occurring on 1.4.7...

Git Bash terminal (mintty) inside of Hyper.

bcorcoran avatar Sep 26 '17 17:09 bcorcoran

I believe it has to do with line endings. While in vim in hyper on a Windows computer, you copy stuff with carriage return + line feed endings (\r\n, one line on Windows). I believe vim recognizes this as two lines (\r + \n, two lines on Unix), and so pastes an extra line. But, I'm not so sure. Read more about line endings here and tell me what you think and what can be done to fix this.

ghost avatar Oct 08 '17 06:10 ghost

When copying and pasting from Chrome for example. I get the extra lines when pasting directly to Hyper. However, if I paste to WSL mintty, I do not get the extra lines.

jcolesio avatar Oct 11 '17 16:10 jcolesio

@jcolesio if you paste that into your editor, and turn on "show line endings" what do you see?

albinekb avatar Oct 11 '17 18:10 albinekb

@albinekb im not sure vim would show line endings properly. do you have a recommendation on what to use instead?

jcolesio avatar Oct 11 '17 20:10 jcolesio