Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hinting #16

Open
aleclarson opened this issue Feb 14, 2018 · 12 comments
Open

Support for hinting #16

aleclarson opened this issue Feb 14, 2018 · 12 comments

Comments

@aleclarson
Copy link
Contributor

See here: https://github.com/antirez/linenoise#hints

@hoelzro
Copy link
Owner

hoelzro commented Feb 15, 2018

Thanks for the report! For this one, I'll just need to grab what's upstream and wrap it - #17 has a similar story. I should be able to get around to this within the next few days.

@hoelzro
Copy link
Owner

hoelzro commented Feb 16, 2018

Hi @aleclarson - I took a stab at this and #17 tonight. Could you pull down the new code and let me know what you think?

@aleclarson
Copy link
Contributor Author

Hey @hoelzro - I'll let you know when I get some time to try it out. Thanks!

@hoelzro
Copy link
Owner

hoelzro commented Mar 4, 2018

@aleclarson Have you had a chance to look at this?

@aleclarson
Copy link
Contributor Author

When the sethints callback is triggered, my terminal goes bonkers with weird whitespace and a segmentation fault occurs (at least in Tarantool).

Segmentation fault
code: SEGV_MAPERR
addr: 0x13
context: 0x10ad6c978
siginfo: 0x10ad6c910
Current time: 1520203843
Please file a bug at http://github.com/tarantool/tarantool/issues
Attempting backtrace... Note: since the server has already crashed, 
this may fail as well
#0  0x1085b83b9 in print_backtrace+9
#1  0x1085067d8 in _ZL12sig_fatal_cbiP9__siginfoPv+158
#2  0x7fff56a74f5a in _sigtramp+1a
#3  0x108632d86 in lj_alloc_malloc+66
#4  0x10ab524ca in hints_callback_wrapper+ea
#5  0x10ab528db in refreshShowHints+cb
#6  0x10ab53590 in refreshLine+870
#7  0x10ab52b11 in linenoiseEditInsert+91
#8  0x10ab543d3 in linenoise+523
#9  0x10ab51dfc in l_linenoise+4c
#10 0x1085d1015 in lj_BC_FUNCC+44
#11 0x1085ddcd8 in lj_dispatch_ins+2b8
#12 0x1085d2dab in lj_vm_inshook+31
#13 0x1085e7582 in lua_pcall+a2
#14 0x1085a9ca3 in luaT_call+13
#15 0x1085a59d6 in lua_fiber_run_f+66
#16 0x10850633c in _ZL16fiber_cxx_invokePFiP13__va_list_tagES0_+c
#17 0x1085b60da in fiber_loop+4a
#18 0x108702b1b in coro_init+4b
tarantool: line 54: 19275 Abort trap: 6           tarantool ./__entry__.lua

@hoelzro
Copy link
Owner

hoelzro commented Mar 5, 2018

Oh no! Does this happen with a standalone Lua interpreter? Maybe it's some version mismatch with the version Tarantool's embedding and the version the shared library was compiled against, or (hopefully not) there's something sinister going on when integrating with Tarantool. What version of Lua is Tarantool using, and what version was the shared library compiled against?

@hoelzro
Copy link
Owner

hoelzro commented Apr 5, 2018

@aleclarson Do you mind if we migrate the later issue with the segfault to its own issue?

@aleclarson
Copy link
Contributor Author

aleclarson commented Apr 5, 2018

👍

Sorry for not following up. I forgot about that issue, and gave up on hinting since it wasn't required for my use case.

@epicfilemcnulty
Copy link

@hoelzro Hey, so do hints work or not? =) Judging by the docs they should, but I did not get any hints using the example code...

@hoelzro
Copy link
Owner

hoelzro commented Jun 10, 2022

@epicfilemcnulty They should be working - which example code are you trying that they're not working on?

@epicfilemcnulty
Copy link

@hoelzro I'm using the example code from the README in the repo, and hinting does not work =(

@hoelzro
Copy link
Owner

hoelzro commented Jun 12, 2022

Ok, thanks for clarifying - so when you say it doesn't work, does the program crash, does nothing special happen, etc? The way I test it is to run it and type h - after that I see a little hint show up.

Also, which terminal are you using, and how are you installing the library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants