Tab-completion for V8 interpreter?
I'm using V8 javascript interpreter on the command line but 开发者_开发知识库it has no tab-completion.
Is it possible to add it somehow?
I presume you mean the shell
sample? (scons sample=shell
). It doesn't support tab completion out of the box (there's no config option, etc.), but if you are comfortable with C/C++, it should be relatively trivial to enhance it to add tab completion using GNU Readline.
Likely it doesn't use readline
by default because of licensing issues (and why introduce the dependency for a sample), but that doesn't stop you from supporting it in your installation.
The example 'shell' is a toy application only meant to demo v8 development.
These instructions show how to build d8
(the v8 developer console) with readline support. This will work for Ubuntu/Debian. For other distributions, you will need to replace the apt-get command with whatever package tool you have available.
sudo apt-get install svn scons libreadline-dev
svn co http://v8.googlecode.com/svn/trunk v8
cd v8/
scons console=readline d8
More complete documentation here: http://code.google.com/apis/v8/build.html
精彩评论