Skip to content
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

windows terminal will send one more character when use vim view mode to select characters send to repl #9530

Closed
ZihaoXingUP opened this issue Mar 18, 2021 · 30 comments
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.

Comments

@ZihaoXingUP
Copy link

windows terminal will send one more character when use vim view mode to select characters send to repl

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 18, 2021
@skyline75489
Copy link
Collaborator

OK a lot of things are missing. What repl are you using? Are you using PowerShell? Are you using WSL?

You can't expect us to help you with almost no useful information.

@ZihaoXingUP
Copy link
Author

OK a lot of things are missing. What repl are you using? Are you using PowerShell? Are you using WSL?

You can't expect us to help you with almost no useful information.

i use vim-repl vim-repl, Nvim-R , both of them in windows terminal will send one more character in WSL vim environment. but when i use vim-repl or Nvim-R in xshell or linux system's terminal ,they are working fine and won't send one more character.
so , i think it's windows terminal's problem and need to be solved.

@skyline75489
Copy link
Collaborator

Can you attach a screenshot of something to illustrate this issue? Also, what is the terminal version you are using? And the Windows version?

@skyline75489
Copy link
Collaborator

Yeah there's probably a lot of hidden problems in Windows Terminal and we all want to solve them. We'd love to hear feedbacks from the community. Just we need like a lot of information to determine what exactly the problem is and possibly find a way to fix it. So please be sure to provide as much as information as you can when you submit issues on Github.

@ZihaoXingUP
Copy link
Author

Yeah there's probably a lot of hidden problems in Windows Terminal and we all want to solve them. We'd love to hear feedbacks from the community. Just we need like a lot of information to determine what exactly the problem is and possibly find a way to fix it. So please be sure to provide as much as information as you can when you submit issues on Github.

i only select the 'a' in vim view mode ,but it sent the 'a=' in windows terminal preview 1.7.572.0 in windows 10 1909 for a long time of all version windows terminal i have used, but it will be ok in Xshell or linux terminal's vim .

image

@skyline75489
Copy link
Collaborator

OK I've tried the plugin (nice plugin, btw) but I can't repro this locally. I'm using WSL2 (Ubuntu 20.04) and Vim 8.1. Are you using WSL2?

@ZihaoXingUP
Copy link
Author

i use the WSL1(Ubuntu20.04), but when i use windows terminal's cmd or wsl to connect the linux sever by ssh , it also will send one more character in vim view select mode.

@ZihaoXingUP
Copy link
Author

OK I've tried the plugin (nice plugin, btw) but I can't repro this locally. I'm using WSL2 (Ubuntu 20.04) and Vim 8.1. Are you using WSL2?

i meet this problem in cmd , wsl of cmder's terminal or windows terminal. but in xshell or linux system's terminal, it work ok.

@ZihaoXingUP
Copy link
Author

OK I've tried the plugin (nice plugin, btw) but I can't repro this locally. I'm using WSL2 (Ubuntu 20.04) and Vim 8.1. Are you using WSL2?

it will always send one more character and will report error unless there is a space after it in windows terminal,

@DHowett
Copy link
Member

DHowett commented Mar 18, 2021

Can you send a screenshot from xshell?

This is a common problem people have with vim.

The character under the cursor is part of the visual selection. This is true on every terminal emulator.

Here is putty.

image

image

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 18, 2021
@DHowett DHowett closed this as completed Mar 18, 2021
@DHowett DHowett added the Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons. label Mar 18, 2021
@ZihaoXingUP
Copy link
Author

Can you send a screenshot from xshell?

This is a common problem people have with vim.

The character under the cursor is part of the visual selection. This is true on every terminal emulator.

Here is putty.

image

image

i send you the screenshot on xshell, it works very well and won't sent one more character ,it is the windows terminal's problem, you can also check it on xshell.
image

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 18, 2021
@DHowett
Copy link
Member

DHowett commented Mar 18, 2021

How do you select a? Mouse? Keyboard?

If keyboard, what do you press? Please help me reproduce this issue 😄

@ZihaoXingUP
Copy link
Author

How do you select a? Mouse? Keyboard?

If keyboard, what do you press? Please help me reproduce this issue 😄

i sleep last night when you reply me . now ,i just wake up. i use the keyboarkd and do not use the mouse in vim.
using vim-repl plugin, first , i press the 'v' in keyboard to start the visual vim mode, then, i press 'hjkl' to select the words or lines that i want to send , at last , i press the '+w' to send the words or lines i selected to run them in vim.
you can check more details on vim-repl or Nvim-R

@skyline75489
Copy link
Collaborator

OK this is what I got:

  1. Enter visual mode:

image

Then +w will send a only

  1. Press l

image

Then +w will send a=.

Is this what you seeing?

@ZihaoXingUP
Copy link
Author

OK this is what I got:

  1. Enter visual mode:

image

Then +w will send a only

  1. Press l

image

Then +w will send a=.

Is this what you seeing?

yeah, the method is just like what you said, in windows terminal, if you select 'a', it will send 'a=' because it will send one more character in windows terminal, but in xshell, it will only send 'a', so, it can work well in Xshell.
so ,the windows terminal have this problem in vim-repl.

@skyline75489
Copy link
Collaborator

How about just do not press l? This way it only sends "a", right?

Seems to me entering visual mode will automatically select "a".

@ZihaoXingUP
Copy link
Author

How about just do not press l? This way it only sends "a", right?

Seems to me entering visual mode will automatically select "a".

i just never press 'l' to select the right side character '=', i only select the 'a' character in the vim visual mode ,but it will send 'a=' in windows terminal,
for example, there is a 'year=5' code, ,in windows terminal, if you select "yea", it will send "year", if you select "year", it will send "year=", so , it will always send one more character in windows terminal automatically.

@skyline75489
Copy link
Collaborator

So you're saying if you repeat what I did, just press v, enter the visual mode, the terminal will send a=?

@ZihaoXingUP
Copy link
Author

So you're saying if you repeat what I did, just press v, enter the visual mode, the terminal will send a=?

i repeat it, in windows terminal's vim , if you just press v, it will send a, if you also select a , it will send a=

year=5 ,if you select yea ,it will send year ,if you select year, it will send year=

@skyline75489
Copy link
Collaborator

OK, now I see. Listen to me very carefully:

if you just press v, it will send a

when you press v, it already selected a! That's why it sends a.

if you also select a , it will send a=

How do select a? Are you pressing l ? If you press l, it selects a=, that's why it sends a=. I know it looks like you're selecting only a. That's the point in #9530 (comment) . It's not exactly the same as what you see.

@ZihaoXingUP
Copy link
Author

OK, now I see. Listen to me very carefully:

if you just press v, it will send a

when you press v, it already selected a! That's why it sends a.

if you also select a , it will send a=

How do select a? Are you pressing l ? If you press l, it selects a=, that's why it sends a=. I know it looks like you're selecting only a. That's the point in #9530 (comment) . It's not exactly the same as what you see.

i think you do not know it , a is too short, many times ,the variable is a long word ,you want to select the whole word to run it , ,year=5, if i select year and the cursor is year, it will send year= in windows terminal. if i can't select the whole word , i will feel very terrible every times

if i select year and the cursor is year, it will just send year in xshell, it works very well in xshell.

it is so terrible that if i want to send year, i only can select yea in windows terminal, rather than i can select the whole word year in xshell or linux terminal.

if you use the windows system ,i hope you can use xshell to run it , it works very well . in windows terminal ,it was really terrible and unfriendly, that you only can select yea, you can't select year

@ZihaoXingUP
Copy link
Author

i hope you can use xshell to run it , it works very well . in windows terminal ,it was really terrible and unfriendly, that you only can select yea, you can't select year

OK, now I see. Listen to me very carefully:

if you just press v, it will send a

when you press v, it already selected a! That's why it sends a.

if you also select a , it will send a=

How do select a? Are you pressing l ? If you press l, it selects a=, that's why it sends a=. I know it looks like you're selecting only a. That's the point in #9530 (comment) . It's not exactly the same as what you see.

Do you know Xshell in windows systerm? you can use xshell to run it , Xshell terminal can works very well . in windows terminal ,it was really terrible and unfriendly, that you only can select yea to run it, you can't select year

@skyline75489
Copy link
Collaborator

OK. Can you repeat what I did in #9530 (comment) and attach the screenshot? I'd like to see how it looks like.

@skyline75489
Copy link
Collaborator

Yeah I know XShell. We all know what it is. First, XShell is a commercial software that we can not just grab and use. Do understand the strict copyright restrictions in Microsoft about what we can use. Second, this isn't about how XShell behaves, this repo is about Windows Terminal. And we all want it to be better.

@ZihaoXingUP
Copy link
Author

Yeah I know XShell. We all know what it is. First, XShell is a commercial software that we can not just grab and use. Do understand the strict copyright restrictions in Microsoft about what we can use. Second, this isn't about how XShell behaves, this repo is about Windows Terminal. And we all want it to be better.

in windows terminal

select yea

in the widnows terminal ,if i select yea, it will send year

image

select year

if i select year, it will send year= in windows terminal

image

In Xshell

slelect yea

if i select yea, it will send yea

image

select year

if i select year , it will send year
image

@skyline75489
Copy link
Collaborator

skyline75489 commented Mar 19, 2021

OK. I completely understand what you mean. I can think of two options.

  1. Put these in your .vimrc:
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"

See #4335 (comment) for details.

  1. Put this in your terminal settings.json:
"cursorShape": "bar",

See here for details about the cursorShape option.

@ZihaoXingUP
Copy link
Author

OK. I completely understand what you mean. I can think of two options.

  1. Put these in your .vimrc:
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"

See #4335 (comment) for details.

  1. Put this in your terminal settings.json:
"cursorShape": "bar",

See here for details about the cursorShape option.

ok, i change the window terminal settings , thanks!

@skyline75489
Copy link
Collaborator

You're welcome.

Please try to understand & describe your problem before getting into discussions like this one. If you want us to help you, first you need to make sure we understand you. If you issue was "I want block cursor instead of bar cursor", this issue would've been solved yesterday, without 20+ emails sent to everyone subscribe this repo. Keep saying "the windows terminal have this problem in vim-repl" does NOT helps anyone.

Please understand that reading the issues and get involved in discussions takes time. We all want to help the community but time is valuable for everyone.

Check out How-To-Ask-Questions-The-Smart-Way(中文) to learn how to answer a good question.

If you don't feel comfortable writing in English, write in Chinese and I'll translate for you. Just make sure you're asking a *good question.

@skyline75489
Copy link
Collaborator

If the article feels too long, I've picked the most important section I can think of:

Don't rush to claim that you have found a bug

别动辄声称找到 Bug

@ZihaoXingUP
Copy link
Author

If the article feels too long, I've picked the most important section I can think of:

Don't rush to claim that you have found a bug

别动辄声称找到 Bug

haha, i see and learn the artical, thanks! ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.
Projects
None yet
Development

No branches or pull requests

3 participants