To remind yourself how much we take for granted, play with `psql --no-readline` some time and see how awful it is to lose the ability to up-arrow get the last query back, edit it, and send it again.
To remind yourself how much we take for granted, play with `psql --no-readline` some time and see how awful it is to lose the ability to up-arrow get the last query back, edit it, and send it again.
On the bright side, that experience did cause me to do a little research and learn about readline, which I hadn't realized was a library I could make use of for my own stuff before then!
https://www.oracle.com/database/sqldeveloper/technologies/sq...
The sqlplus client continues to have all the problems that you have outlined. When sqlplus runs on the Windows command line, it does inherit command history.
in retrospect it's kind of stupid that ms-dos didn't have fantastic command-line editing and history facilities, since it had guaranteed control over the whole screen, a known keyboard layout, guaranteed at least 64k of ram, and was running milliseconds away from your fingertips without having to timeshare compute resources with other people or background compilation tasks (etc.). from today's perspective, it seems like a no-brainer in this context to build in a rich command-line history feature with search, cut, paste, and movement by words for command-line editing, plus filename completion. readline is solving a much harder problem given that it had to do everything through termcap and degrade gracefully on shitty terminals! maybe it's a harder sell when you have to write it all in 8088 assembly, or (more likely) when you've never used a system like that before
(for batch files, it also seems like a no-brainer to implement something like the bourne shell's control structures, and there was less excuse for not doing that, given that they were already aping unix's hierarchical filesystem)
it makes me wonder what kind of obvious improvements on today's computer systems we're missing
When it isn't just use 'rlwrap.'
> some time and see how awful it is to lose the ability to up-arrow get the last query back, edit it, and send it again.
[A
Apparently, a pretty incurious one.
when you want a program to get everything the keyboard sends (which means the program will have to handle everything the keyboard sends), your program needs to put your tty into "raw-mode". If you want the operating system to handle things like backspace or left-arrow to correct typos, instead of putting it into raw mode, your program just leaves it with the default in what-came-to-be-called "cooked mode"; cooked mode generally means a line will be sent at a time after ENTER, instead of char by char as keys are pressed (note, this is not the same as half and full duplex, though it is related).
Programs can be linked to use readline to read, while the rest of the program can be written as if the tty is in cooked mode; readline will handle the raw mode. Upon receiving characters typed and an ENT, readline will send cooked lines
If your program is getting char by char in raw mode, you need to realize that some keys don't send single chars, they send a series of chars, generally an "escape sequence", both because the sequence needs to be escaped, and also because the sequences escape with the ESC key-char.
you can get into weird modes where the ESC chars get swallowed but the rest of the key-chars pass through. That's what you are seeing when you see letters get typed but not interpreted as arrow key movements. if your keyboard is persistently screwed up, you can use stty to reset it, or if you are really fancy, set it the way your non-functioning program expects it to be set.
GPLv3 means that you can't use it with the code you write for your job. And there are cases where readline can sneak into the codebase through unintended routes.
(emphasis mine)
I know you get the distinction, but I hear too often that "we can't use GPLv3 software at work" from people who aren't clear on it.
It is. E.g. if you have a contractor working with your company, then giving software can be considered "distribution". And the contractor can gain the right to re-distribute your internal software.
It's OK to use GPL for software that runs in separate processes (e.g. GDB), but readline is really sneaky because it's a library.
I've never been tempted to think I had any right whatsoever to my employers' internal materials. That would be a highly unusual, maybe unprecedentedly so, situation.
Technically, a litigious-happy contractor can use that to cause a lot of damage to the company. So that's why many companies (e.g. Apple) just ban as much GPLv3 software as they can.
> To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
in their faq about gplv2, the fsf explicitly takes the side of your hypothetical 'litigious-happy contractor' https://www.gnu.org/licenses/gpl-faq.en.html#InternalDistrib...
> Is making and using multiple copies within one organization or company “distribution”? (#InternalDistribution)
> No, in that case the organization is just making the copies for itself. As a consequence, a company or other organization can develop a modified version and install that version through its own facilities, without giving the staff permission to release that modified version to outsiders.
> However, when the organization transfers copies to other organizations or individuals, that is distribution. In particular, providing copies to contractors for use off-site is distribution.
note that this is talking about gplv2 ('distribution'), so presumably contractors can already sue apple for this if apple uses gplv2 code in internal tools; they might not win, but the fsf thinks they should
My current bane is BlueZ, which used to allow for a compile-time removal of readline but no more.
He was basically saying that seeing readline pulled as one of the dependencies gives him confidence that the tool won't suck. He said nothing about building tools with readline support (implicit or otherwise).
... you did write and release a replacement in the license you like, right? right?
What's this friction between readline and other licenses in other Free Software code? Unless I'm writing some software with a non-GPL license and want to include GPLed software in my own that I plan to distribute, it doesn't affect me.