-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for issue #11205 :terminal #11348
Conversation
…ith the windows powershell terminal
Makes sense. Could you update the failing tests? (and check that they will fail for the old behavior, maybe that is enough for tests then). |
I'll do so as soon as I get back to my windows machine. |
Merge fork
…ue. Pasting now works on windows with \r and on unix with \n
@Liberatys what changed in the latest push? Do you plan to update the tests any time soon? |
@justinmk I have to apologize. I had a lot going on and always pushed it. After multiple times of going through the tests and trying to figure out what to change .. I have to admit that I don't seem to get how to test for the new behaviour. Could someone with more knowledge finish this fix? Thank you very much. |
Pushed a lint fix. |
AppVeyor failures are relevant:
Code for the first one: neovim/test/functional/terminal/buffer_spec.lua Lines 86 to 98 in 5b6466a
Should "\r" only be used for Powershell then maybe? |
Would be great to finish this... |
src/nvim/terminal.c
Outdated
# ifdef UNIX | ||
terminal_send(curbuf->terminal, "\n", 1); | ||
# else | ||
terminal_send(curbuf->terminal, "\r", 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
terminal_send(curbuf->terminal, "\r", 1); | |
terminal_send(curbuf->terminal, "\r\n", 2); |
This might do it? (untested)
@@ -526,7 +526,11 @@ void terminal_paste(long count, char_u **y_array, size_t y_size) | |||
for (size_t j = 0; j < y_size; j++) { | |||
if (j) { | |||
// terminate the previous line | |||
terminal_send(curbuf->terminal, "\n", 1); | |||
# ifdef UNIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what are the different possible platforms are. But would it be possible to have a non-unix platform that doesn't use \r\n
?
If this is the case, it would mean they would fall under the #else
and receive the wrong characters.
Sorry, I haven't really been following. Why close this? |
@NilsIrl Oh wow .. I'm sorry ^^ I was rechecking what you wrote before and wanted write a comment... must have slipped .. sry. Currently checking your reviews on my machines. |
The conditional sending of \n and \r\n as proposed by @NilsIrl to the terminal seem to pass on the appveyor test and also worked on my local machine. The failure in builds.sr.ht: openbsd.yml is unrelated to the change. The failures in continuous-integration/travis-ci/pr seem to be related to the change. s390x - big-endian
AMD64 - gcc-32bit
Which both make no sense to me, because Linux xenial shouldn't be influenced by the change. |
Superseded by #18723 |
Changing the line termination from \n to \r. Fixing an issue, where the :terminal powershell would have its paste in reverse order.
Checked on windows as well as on mac with powershell core.
Fixes #11205.