From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | psql & readline & win32 |
Date: | 2006-01-01 11:49:40 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCE92E96A@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Getting started early this year, I've finally found a way around the issues with readline on win32. And it just took a little bit of google research and some testing.
Recap of the problem: When running psql in a readline enabled mode on win32, any character requiring the AltGr key to generate will not work. In a lot of non-US locales, this includes the backslash key, which makes psql pretty darn unusable. The "fix" for this that went into 8.0 is to disable readline on win32 pending a fix.
Now, this can be fixed. And it's as simple as specifying an inputrc file. For backslash, this file needs to contain:
"\M-\\": "\\"
And then similarly for every other character requiring AltGr.
Considering we have a fix, I think we need to re-enable readline on win32, and document this. However, there are a couple of things to decide on first:
1) Should it be made default? As it requires you to include this file to work, perhaps it should be set to non-default and specifically require a --with-readline? Also depends on th eanswers of a couple of questions below, I think.
2) Should we ship a file of standard bindings. We're not going to get it complete, but we could get some of the most common ones in europe at least (in sweden, this would for example include "\(at)£${[]}~|"). Which would help people a lot.
3) How should the inputrc file be loaded. By default, you have to type SET INPUTRC="\some\where\inputrc" before you launch psql. But we could just as easily add:
#if defined(WIN32) && defined(USE_READLINE)
rl_read_init_file(our_path_to_inputrc);
#endif
to psql, making that step a whole lot easier. Especially for people who launch psql from the startmenu, and can't specify program-specific env vars.
If we wanted to, we could even bind the keys using rl_parse_and_bind() or similar, but keeping it in a separate file makes it possible to edit it without recompiling, which is a definite plus.
4) Can we ship linked with readline in the installer? If not, can we ship a readline-linked binary at all, or just the source? Considering readline drags along the GPL, and not just the LGPL. (We can link either statically (default) or dynamically (separate package) to readline without problems, from what I can tell)
I think we ship readline-linked RPMs, but I'm not sure about that?
Now even if we can't ship readline linked binaries in the installer, it's still a good thing to provide the ability to build them, of course :-)
//Magnus
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-01-01 17:42:21 | Re: Checks for command string |
Previous Message | Martijn van Oosterhout | 2006-01-01 11:12:24 | Re: Removing SORTFUNC_LT/REVLT |