davidledwards/zookeeper

Extra trailing '/'s cause a "JLine support is disabled" error

Closed this issue · 2 comments

When tab completing to browse through a hierarchy in zookeeper, I found that having an additional trailing slash after a path causes the client to start behaving weirdly.

E.g. In the following output, the TAB key is hit once after each "/" is appended to the string to be autocompleted:
ganderson@ganderson:~$ zookeeper-client
Connecting to localhost:2181
log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
Welcome to ZooKeeper!
JLine support is enabled

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /

hbase zookeeper
[zk: localhost:2181(CONNECTED) 0] ls /hbase/

splitlog unassigned table94 rs backup-masters draining table
[zk: localhost:2181(CONNECTED) 0] ls /hbase//JLine support is disabled

A similar behavior is observed when there's 2 slashes at the beginning of the string and you try to tab-complete the first directory level in:

e.g.:
[zk: localhost:2181(CONNECTED) 2] ls //

hbase zookeeper
[zk: localhost:2181(CONNECTED) 2] ls //hbase/JLine support is disabled

It looks as though you're running the console client that ships with the ZooKeeper distribution in bin/zkCli.sh, which seems to have a number of problems with TAB completion. Since this project was designed as a better alternative, you might consider logging an issue with the ZooKeeper project.

In the meantime, check out the documentation for installing and using this new client. It just dawned on me that the documentation still makes reference to a 1.0-SNAPSHOT when in fact there is a 1.0 version available. You can find a prebuilt tarball here.