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 Can you paste the exemple ? Screenshot
@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 Tested and working like a charm for me... need a picture from your part as example. I can't reproduce.
Same here. No extra spaces 🤔
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.
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.
Yup, I have the same issue. Windows 10 Build 14393 on Hyper 1.3.1
Can't reproduce with W10 Pro 14393 on Hyper 1.3.1 ☹️
i can reproduce, copy pastes are weird.
last w10 / last hyper.
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.
Confirmed with Windows 10 1703(15063). Not a huge problem but it does get a bit annoying sometimes.
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
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_
I also have this issue: Windows 10-1703 Build 15063.540 with Hyper 1.4.2
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.
Still occurring on 1.4.7...
Git Bash terminal (mintty) inside of Hyper.
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.
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 if you paste that into your editor, and turn on "show line endings" what do you see?
@albinekb im not sure vim would show line endings properly. do you have a recommendation on what to use instead?
any word on the status of this issue?
I do believe it has everything to do with CRLF on Windows. I would like there to be an option in Hyper that forces "paste" to output LF only. That would solve this issue.
My workaround for this at the moment is to create a new document in Atom (or any other editor that supports changing line endings), make sure it is in LF, paste in what I want to put into vim, copy it all again, and finally paste into vim (hyper).
Clearly not ideal.
However, an LF only option for paste would be nice because I, personally, have never run into an issue where I actually needed CRLF output when doing something in Hyper. I use Hyper+Git Bash on Windows because there are really no better options for doing daily linux/unix tasks in Windows.
Would it not be possible to intercept the paste and check if on a windows platform and then adjust the line termination appropriately?
Yes, that's possible @alexjmoore
I beleive this is where you could add it https://github.com/zeit/hyper/blob/8aa7d90ff1df47cab3d1a6c9ee52cb03a7b45a95/lib/hterm.js#L188-L193
in 1.x, don't send a PR there since we use xterm.js in 2.0, we need to find how this works with xterm.js, maybe @chabou has some insight?
also thanks for the info @bcorcoran !
Something like this maybe? :
if (os.platform() === "win32") {
text.replace(/\r\n/g, "\n");
}
any luck guys with this issue?
Here's a gif of the issue:
Is it spaces or line breaks that are being added?
It is because on Windows the end of a line is signified by a carriage return (r) and a newline (\n), whereas on nix systems those are two separate end of line characters, hence why when you paste out of the windows clipboard you get the two new lines, the intended one and an extra one - causing the 'space' between the lines. General fix I *think is to simply swap occurrences of "r\n" with a single "\n" on a paste action when on a windows platform. As per my suggestion above combined with the code location identified by @albinekb
Issue seems to be fixed as of latest canary branch/version 2.0 (probably due to xterm).
Looking forward to a stable 2.x release then!
Just tried 2.1.1 and the problem is fixed.
The double newline is gone, but there's still an extra newline where there instead should have been line wrapping.
Is there a compiled build of 2.x floating around somewhere or does it have to be built manually?
@gauthier-delacroix
@isseiler I don't remember where I've found a 2.1.1 release (there isn't even a tag for this version), but all releases are available there: https://github.com/zeit/hyper/releases
2.1.1 was released as a canary release when zeit/hazel didn't have support for pre-releases. We later released 2.0.0-canary.x instead, to indicate that it will be the stable 2.0.0 release.
To get the latest canary you will need to manually re-install the latest one, and it should start to update correctly again. Sorry for the inconvenience.
I'm seeing a version of this behaviour. When I copy stuff from hyper and paste it elsewhere, e.g. into VS Code or Slack it all ends up mashed together on one line instead of broken up as it appears in the terminal.
@tstackhouse it sounds like this is a completely different issue (even if it is related to line endings), so if I were you I would create a new issue.
My situation is a little different :
pasted
Anyone know why and how to fix ?
That is not a hyper issue. :set paste in vim to stop auto-indent temporarily. :set nopaste to get it back.
On Apr 11, 2019, 04:06 -0400, eromoe notifications@github.com, wrote:
My situation is a little different :
pasted
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
It is not vim, I am in ipython interpreter .
This doesn't happen when I am using msys2
Sorry, but it still isn’t an issue with hyper. https://stackoverflow.com/questions/10886946/how-does-ipythons-magic-paste-work
On Apr 11, 2019, 21:16 -0400, eromoe notifications@github.com, wrote:
It is not vim, I am in ipython interpreter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
You are right, thank you for point out that . I used cat
to test wsl in hyper and indent didn't go wrong . However I am using ipython 7.4.0 which shouldn't get this problem, I would seek help on ipython repo .
Most helpful comment
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.