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

How do I paste text from the clipboard into the console editors without breaking the formatting? #9922

Closed
237dmitry opened this issue Apr 22, 2021 · 14 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@237dmitry
Copy link

237dmitry commented Apr 22, 2021

The insertion of text breaks the formatting. When are you fix the problem? 2.0, 3.0, or never?

excessive flaming

Instead of solving actual problems, you are implementing new dubious functionality. And most importantly - you absolutely do not want to listen to issues.

I'm already mute about the support of the mouse in third-party applications, it's probably beyond the universe. Why are there no such problems in other console emulators, which, by the way, also use the standard Windows Console Host? Look at ConEmu, Alacritty, etc.

@237dmitry 237dmitry added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Apr 22, 2021
@DHowett

This comment has been minimized.

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 22, 2021
@DHowett

This comment has been minimized.

@237dmitry

This comment has been minimized.

@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 Apr 22, 2021
@DHowett

This comment has been minimized.

@237dmitry
Copy link
Author

Can you share a screen recording?

I can't record. Just screenshots. In the first one I am copying text and in the second pasting in editor.
This behavior is not only in Far but in micro (editor) the same. This is a small text, but in a large pasting text pasted with animation and with increasing whitespaces before string.
The dots in editor are the whitespaces.

copy
past

@DHowett
Copy link
Member

DHowett commented Apr 22, 2021

Ah, I understand what's happening. When you copy that text, it contains the leading spaces (we cannot delete them -- users become very upset when we delete them!). When you paste, the editor is not aware that it is pasting, and it receives the leading spaces. Its autoindent feature kicks in, preserving the initial indent from the first line.

This is a common problem:

This is one of the problems "bracketed paste mode" is supposed to solve. It is something that the application, or the user configuration, will need to add support for. OTHERWISE, There is no standard way to tell the application that the content is coming from the clipboard. It looks to the application like the user simply typed the content in.

This is a difficult one to fix because it requires application-specific work. Even if we can fix it for some applications, we cannot fix it for all applications unless they support bracketed paste mode.

@237dmitry
Copy link
Author

This is a difficult one to fix

It's pitty a news. Other console emulators have not such a problem. And mouse working.... I'm sorry, I'm just sick of it. Why one man could to write the perfect Tilix but not to do the same the whole Microsoft?

@skyline75489
Copy link
Collaborator

Well, if you want the technical details: the console subsystem on Windows is dramatically different from the one on Linux. Traditional console programming on Windows relies on Win32 APIs. On Linux console programming relies on string handling(VT). To better support both kinds of applications, the entire console subsystem on Windows was moved to the new ConPTY infrastructure. In conclusion, there a lot more compatibility issues on Windows than on Linux, due to the legacy Win32 console support.

Also Tilix depends on VTE, which has I think more than decades of history. So i would not really call it “written by one person”. And we can not just use VTE, due to licensing issue. It’s not a perfect world. I get it. But we just have to live with it.

@skyline75489
Copy link
Collaborator

skyline75489 commented Apr 23, 2021

You mentioned ConEmu. I love ConEmu and use it myself on older systems where Windows Terminal can’t be used. It’s a fantastic product. We actually reuse some of the ConEmu sequences inside Windows Terminal. And the author of ConEmu sometimes gets involved in discussions in the terminal repo, to make sure we are going to the right direction. To quote Dustin’s word, we never want Terminal to be the only choice on Windows. If you like ConEmu more just use it at your free will.

by the way, also use the standard Windows Console Host

This is technically inaccurate but I will not bother you with the details. We want to see good terminals on Windows. We all do. But do realize that developing the terminal is a slower process that developing a third-party terminal like ConEmu, because some of the code will be merged back to Windows which will potentially influence millions of Windows users. If you’re living in a world where people just fulfill your needs (for free) at the risk of sabotaging millions of other people, then I’m ok with it.

Also need I remind you that ConEmu itself has I think over a decade of history. Writing software is hard. Writing code for Windows is even harder. You don’t see the author of other terminal authors dissing Windows Terminal because we all know how hard it is. If you want to contribute to the process by reporting issues, we welcome you. Please don’t just spread hatred words, which solves nothing.

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Apr 23, 2021
@zadjii-msft
Copy link
Member

For the record, bracketed paste (#395) should be working in Windows Terminal as of v1.7.572.0 (see #9034). What version of micro are you using? Is is a Windows exe or one you're using with a WSL distro?

We'd love to be able to help diagnose this issue, but engaging in a flamewar isn't gonna get anywhere with us.

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Attention The core contributors need to come back around and look at this ASAP. labels Apr 23, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Apr 27, 2021
@ghost
Copy link

ghost commented Apr 27, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@SuperSandro2000
Copy link

I have bracketed paste mode working in vim with Konsole and the following snippet:

" bracketed paste
if &term =~? 'xterm-256color'
  let &t_BE = "\e[?2004h"
  let &t_BD = "\e[?2004l"
  exec "set t_PS=\e[200~"
  exec "set t_PE=\e[201~"
endif

What do I need to change that this works under the latest Windows Terminal Preview? My TERM is set xterm-256color and removing the condition does also not work.

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Nov 3, 2021
@DHowett
Copy link
Member

DHowett commented Nov 3, 2021

@SuperSandro2000 That mostly depends on what version of vim you're using, what OS it's running on (Linux via WSL? Windows? Linux?) and how you're communicating with it (SSH?).

@SuperSandro2000
Copy link

SuperSandro2000 commented Nov 3, 2021

Running that on WSL2 on Windows 10.

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 21 2021 08:39:53)
Included patches: 1-2434, 3402-3403, 3409, 3428
....
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish

Not connected via ssh but in a tmux. I tried it without tmux and that did not work better.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants