-
Notifications
You must be signed in to change notification settings - Fork 2
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
Recent Readline changes #4
Comments
Yeesh. That sounds awful. I'm not experiencing it yet. What version of readline are you using? |
I'm on Arch Linux and updated recently, pacman reports The Readline changes document looks like they did mean to consider the terminal type before enabling the feature, but apparently it doesn't react correctly to the Tandy terminal. Not sure if that is a bug in readline, but the Tandy definitely doesn't need whatever bracketed paste does, so turning it off explicitly makes sense anyway. Btw, even with this feature turned off in Coming from a DOS perspective, it's kinda mind-boggling how many layers of abstraction, complexity, potential problems (as well as flexibility, admittedly) Unices manage to squeeze into text terminal access. I'm beginning to think it'd be more future-proof, at least for the purpose of simple extended file storage, to hook my Model 100 up to a little custom BASIC program running in DOSBox (or one of my vintage PCs) instead of solving all of the mysteries of half a century of Unix TTY support and keeping up with the changes that are still going on there :-) |
You're referring to |
Wow, you're living life on the edge.
Yuck. Sounds like Bash 5.1 / Readline 8.1 need to have this bug reported. I'm still on Bash 4, so that's why I didn't experience the same problems.
Are you using a conditional in the .inputrc? Does something like this work for you?
Perhaps it's a security measure. I haven't read enough about bracketed pâte mode yet, but the changelog mentions differentiating between keys that are actually typed and characters that are pasted in. As @ThomasDickey pointed out, the problem is likely that readline is ignoring terminfo. Many programmers seem to have forgotten one of the "archaic", hard-learned lessons of long ago: “Never hard code terminal escape sequences”. The database already exists (terminfo), the library already exists (ncurses), so we have very little reason to keep making that same mistake.
Or, you can update your UNIX box only as often as you update DOS on your PCs. ;-) |
@ThomasDickey, is "bracketed paste mode" supported by terminfo? I couldn't find it in the man page and when I did a web search for it, I only came up with people saying that terminfo ought to have support for it. I'd like to file a bug with readline/bash that they should use ncurses, but I want to have my facts straight. Thanks! |
That could fall into this existing catch-all: The actual control sequence isn't there (nor are the OSC, mouse-tracking), essentially for two reasons:
There's comparable stuff (such as tmux's developer suggesting the capability corresponding to |
Hmm... sounds non-optimal to overload the meaning of a capability, especially one that is only "documented" in the source code of some third-party software. This is too reminiscent of when terminals went around claiming to be "XTerm compatible" when what they meant, at best, was that they were compatible with a certain version at a certain time.
I mentioned ncurses because it would solve several problems for me if Bash used terminfo properly. I was thinking that, with this recent major release of readline, they might be open to suggestions. It's been silly enough that the project has been hard-coding "ANSI color" escape sequences, but hard coding "bracketed paste" is so ludicrous, I hoped this could be the point where they see the value of terminfo. I don't expect Bash or Readline will ever be linked with ncurses proper, but perhaps it could use a subset, like libtinfo or, if they preferred, a re-entrant alternative like unibilium.
Oh, oops. How hard is it to fix that for bracketed pastes?
Is that the case for bracketed paste mode? We could still have a boolean signifying support, right?
Part of what I love about terminfo is that, even if there is only one flavor, it's still easier for developers to do things the right way instead of hard-coding obscure sequences in their programs. This allows for future growth and flexibility, improves clarity, leverages code reuse, and reduces bugs. Terminfo is a win all around.
What are the steps required to add a capability to terminfo? I mean, to do it right, not by fiat, as I apologize for my ignorance, but it seems like the hardest part is deciding on an appropriate name and semantic meaning. (E.g., should there be both boolean and string capabilities.) Then it would just be a matter of documenting it in terminfo(5) and adding it to libtic, libtinfo. Or, am I missing something major? |
Yeah, bit of a split personality. I still run Windows versions that are long out of support (and DOS of course), but all my Linux machines are rolling distros.
Yes, like in your example, but of course for And yes, it does seem to be meant as a security feature, but imho it should be implemented in the client - just prompt the user about filtering out any risky control characters before actually sending the pasted data to the host. The host doesn't need to have a special "safety squints" input mode for this.
Without the context of this discussion, this is like saying "cars were never meant to be used on roads", but yeah... The rest of your discussion is quickly escalating beyond my paygrade, I'll leave you to it ;-) |
well now they're often caught up to the subset containing features that they want.
The usual (preferred) way is for some developer who wants to use a feature, proposing to add the Just adding extensions that someone "might" use doesn't work for me.
sure - someone has to start off expecting to use it in their program ;-)
yes... but to date, most of the bracket-paste scripting has been done by people who prefer to hard-code things.
Using it in an application is the way to go
It's data-only. I don't see that the ncurses library would have to know about it (barring someone inventing a set of functions for manipulating it, integrating that with the input code, etc). More likely, it would be something listed |
People would use terminfo for bracketed paste mode, as seen in the bug report for tcell. Unfortunately, it appears the developers in that case implemented special case logic.
Got it. So, my next step at this point would be to talk to a project, like tcell, and ask them to start using a bracketed paste capability as if it existed in terminfo. After that, I'd get back to you and see if we can make it official. Right? |
yes - that would work. |
A recent update to the readline library seems to have made "bracketed paste mode" enabled by default. Whatever that is, it obviously doesn't work on the Tandy TELCOM and introduces extraneous control sequences that mess up the screen. I'm seeing
?2004h
when I hit Return in bash, and?2004l
just before the prompt after a program ends.After some research, I found that adding a line of
set enable-bracketed-paste Off
to~/.inputrc
turns this new feature off, maybe you want to add that to your readme.The text was updated successfully, but these errors were encountered: