-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I can't record. Just screenshots. In the first one I am copying text and in the second pasting in editor. |
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. |
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? |
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. |
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.
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. |
For the record, bracketed paste (#395) should be working in Windows Terminal as of We'd love to be able to help diagnose this issue, but engaging in a flamewar isn't gonna get anywhere with us. |
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. |
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 |
@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?). |
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. |
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.
The text was updated successfully, but these errors were encountered: