-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add support for XTGETTCAP #98
Comments
Not a fan of this at all. Why do you want this? |
mostly because it started to get used in toolkits. I'd at least like to look into what it is a bit. |
Which one? |
@chrisduerr I think I mentioned? it's notcurses, some recent go toolkits, etc. It's also present in basically any active terminal. |
From my experience, the currently released Neovim 0.10 uses XTGETTCAP as the escape sequence to detect OSC 52 support automatically and thus clipboard function within itself. This is very useful for me when I want to copy code from one remote machine and quickly paste it into another to check something. |
Why wouldn't we want all terminal emulators to support this mechanism? TERM has serious long-term problems. |
Because this also has serious problems, which is why it hasn't really been used by anything for like a century. But people got fed up with trying to make something new work so instead they're trying to switch from one set of problems to another. At the end of the day this just creates fragmentation with no benefits. |
What are the serious problems? |
99% of the features identified in a modern terminfo file are just standard ANSI or DEC sequences, or commonly supported Xterm extensions, that every modern terminal implements. This is why so many terminals can get away with just setting their TERM to xterm-256colors. Inventing a proprietary escape sequence for apps to look up a bunch of ANSI-standard escape sequences is patently ridiculous. And if you're going to say that you're not using If there is a feature that isn't universally supported (like say |
Btw, notcurses is another example of unnecessary Expecting terminals to implement all of the cruft associated with |
OSC 52 is a part of terminfo though already and was that for a while, I have no idea why neovim decided to not use terminfo as a fallback for it, sounds like just a push for The only real place where it kind of matters, is when you ssh into remote without your terminfo installed or with some dated version of it. I'd state again that |
But it's such a convoluted definition considering what little information it provides. For Xterm it's defined as And in the case of nvim, they basically treat it like a boolean capability - if the definition starts with
And that's the root of the problem, because terminfo was a great idea maybe 40 years ago, when you were trying to write an app that could work on many different hardware terminals with wildly different escape sequences. In this day and age, assuming you're writing a modern application targeting modern software terminals, terminfo causes more problems than it solves. That said, if you (Alacritty) actually want to support |
There's also issues beyond what you mentioned, like the question of which terminfo to report and the fact that you need to query non-standard stuff like Smulx separately since processing is interrupted as soon as any invalid name is found in the requested list. |
I personally don't mind if certain apps really force the rest by starting doing so, but I just don't like it myself either. |
can you force neovim to enable it? Sounds like there should be a way to do so. |
The mechanism still seems pretty useful to me. With XTGETTCAP, programs request only the capabilities they need, so why would it hurt anything that information on , say, ANSI capabilities would be harmful, even if most terminals will report the same strings for those capabilities? IMHO, there's a lot of value in having a single converged capability detection mechanism that works for both old, boring capabilities and new, exciting ones. Maybe it'd be simpler to support only Boolean flags instead of parameterized capabilities, but IMHO not simpler enough that it's worth making an alternative feature detection system. I plan to add support for XTGETTCAP to Emacs term, FWIW. I want to solve the ssh problem once and for all. |
Do you understand that terminfo will have new exciting ones as well, since they have the same source and one is based on another? Unless you're talking about a new protocol, nothing will change, except ssh miss-matches, as said. |
Solved with one scp | tic command or running systems that are not 5-7 years old. |
Well this escape isn't that, so I don't see the point. |
Yes, you can: vim.g.clipboard = {
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
},
} (see |
How it works is available at https://invisible-island.net/xterm/ctlseqs/ctlseqs.html .
This is used to query for terminfo features and not relying on the actual files. It's supported by notcursors, most modern terms, etc. It could be sort of good when you ssh into system without TERM info you have and it could help terminals not having their terminfo spread to work with at least modern toolkits.
The text was updated successfully, but these errors were encountered: