[MDEV-6912] shell client control sequences not working (xterm, kde konsole) Created: 2014-10-22 Updated: 2018-10-29 Resolved: 2018-10-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.0.14 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Christian Quast | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
openSUSE 13.1 |
||
| Description |
|
I recently updated to version 10.0.14 from 10.0.11 (using the openSUSE database build service) and in 10.0.14, the shell client no longer accepts control sequences like control+r (search in history) or control+left/right (move cursor one word to the left/right). In case of control+r nothing happens, pressing control+left/right prints ';5D' / ';5C' instead of moving the cursor. Control sequences work fine in 10.0.11. Also, after downgrading to 10.0.11 and using the up key to browser through the command history spaces are replaced by \040 for commands entered in the 10.0.14 shell client. This happens in both KDE's konsole and plain xterm using BASH as shell (I haven't tested other terminals). I have libreadline version 6.2 installed (libreadline6-6.2-68.12.1.x86_64), not sure if this is relevant or what else to report. |
| Comments |
| Comment by Elena Stepanova [ 2014-10-22 ] | ||||||||||||||||||||||||||||||||
|
Hi, I'm getting different results, but it might depend on the compilation settings and environment. (I've built both versions with simple cmake && make, on the same openSUSE 13.1, and on both versions Ctrl-R works and Ctrl+left/right doesn't). When you downgraded to 10.0.11, did you rebuild it again, or did you use the previously built binaries? Could you please paste the output of ldd <path to mysql> for both versions, and INFO_BIN and INFO_SRC files from both builds? When it's built in-source, the files reside in <basedir>/Docs, but I'm not sure where they end up with your build/install setup. | ||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-10-23 ] | ||||||||||||||||||||||||||||||||
|
I've seen it (someone complained on IRC and then we've figured it out). Your build uses libedit, not readline. That's why you get \040 in the history and that's why control sequences don't work. Our readline.cmake file works like this: first it tries to use system readline. Your have readline version 6.2 — but readline6 is GPLv3, which is not compatible with GPLv2. So we can only use readline5, not readline6. If no usable system readline was found, readline.cmake tries to use system libedit. And if that doesn't work, it resorts to bundled readline. In 10.0.14 we've fixed libedit detection in our cmake files (it was broken, because of typos the readline.cmake file it never worked). That's why certain builds that were using bundled readline before now use system libedit. If you build yourself and want to use readline — make sure you either have readline5 installed or don't have libedit installed. Or run cmake with -DNOT_FOR_DISTRIBUTION=1, that will link with readline6, but you won't be able to distribute the resulting binary, it won't be GPL anymore. | ||||||||||||||||||||||||||||||||
| Comment by Christian Quast [ 2014-10-23 ] | ||||||||||||||||||||||||||||||||
|
thanks a lot for the quick and detailed response. openSUSE 13.1 still offers libreadline 5 which is co-installable with libreadline 6 (at least the lib, not the headers). I guess, I am going to report this to the package maintainers over at the openSUSE build service. The OBS offers two sets of packages installing mariadb and its clients. The 'default' mariadb* packages install 10.0.14 and the mariadb_100* packages install 10.0.11. I didn't find any information why they offer two sets of packages but maybe it's related to this problem? thanks again. | ||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-24 ] | ||||||||||||||||||||||||||||||||
|
So, I've tried three variants on openSUSE 13.1 with 10.0.11 and 10.0.14
I also observed the history problems after switching from readline to libedit and back. So, the way you described the current behavior is consistent with 10.0.14 linked with libedit; but if Ctrl+left/right worked with your 10.0.11, it seems you actually had readline5 at that point? Side observations for serg's consideration:
| ||||||||||||||||||||||||||||||||
| Comment by Christian Quast [ 2014-10-24 ] | ||||||||||||||||||||||||||||||||
|
Unfortunately, I cannot provide the build information as I installed the RPM packages provided by the Database OBS. I don't know much about OBS or building rpm packages in general but what I could find is the file build.incl which seems to contain build instructions. As far as I can tell it supports both building MySQL using auto tools and using cmake. In the cmake part I see
However, this hasn't changed between the mariadb_100 and maridb. In fact, the files are identical. The results running of ldd (I guess the mariadb_100 build uses the bundled libreadline 5, openSUSE 13.1 installs version 6 by default as I only installed libreadline5 manually after I opened this report) :
I also reported this issue at http://bugzilla.opensuse.org/show_bug.cgi?id=902396 | ||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-24 ] | ||||||||||||||||||||||||||||||||
|
OK, thanks for the info. Apparently openSUSE doesn't include INFO_BIN file into their packages. Anyway, it's not so important. serg, if there is nothing to do in the scope of this report, please just close it. I'm leaving it open to consider at least the question about visibility of the choice of bundled library in cmake options, and maybe also documenting available choices and their consequences, if not done yet. | ||||||||||||||||||||||||||||||||
| Comment by Teodor Mircea Ionita (Inactive) [ 2018-10-26 ] | ||||||||||||||||||||||||||||||||
|
elenst serg I encountered the readline vs. libedit issue while initially crafting the OpenSUSE docker file. After a discussion on Freenode this issue was created and resolved: |