LibrAdline并未从分页上的Ctrl+ c上退出。输出状态(选项卡上可能完成)
我的应用程序使用libreadline自动完成时区字符串(在按下)timezone
命令。
由于可能的完成情况很多,输出被__更多__
。
在此状态下,如果我按Q
它可以很好地退出,但是如果我按ctrl+c
行为如下所示。打印出来,但打印垃圾)。
$ timezone <tab>
Display all 200 possibilities? (y or n) y
Africa/Maputo America/Moncton Asia/Kuwait Europe/Stockholm
Africa/Maseru America/Monterrey Asia/Macau Europe/Tallinn
Africa/Mbabane America/Montevideo Asia/Magadan Europe/Tirane
Africa/Mogadishu America/Montreal Asia/Makassar Europe/Uzhgorod
Africa/Monrovia America/Montserrat Asia/Manila Europe/Vaduz
--More--^C
�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
^P^?"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ��"^TxU ��"^TxU ^P�"^TxU
0�"^TxU ��"^TxU ��"^TxU @�"^TxU
顺便说一下,我的sigint
处理程序功能如下,我正在使用rl_attempted_completion_function
注册我自己的功能以提供可能的完成字符串char **
。
rl_initialize();
printf("\n");
rl_forced_update_display();
如何使ctrl+c
完全按照分页上的按下q
的行为?
My application uses libreadline to auto complete timezone strings (on pressing tab) for timezone
command.
As there are lot of possible completions the output is paginated with __more__
.
In this state if I press q
it exits fine but if I press Ctrl+C
the behavior is as shown below.. (it wont exit until all the entries in the buffer printed out, but printing junk).
$ timezone <tab>
Display all 200 possibilities? (y or n) y
Africa/Maputo America/Moncton Asia/Kuwait Europe/Stockholm
Africa/Maseru America/Monterrey Asia/Macau Europe/Tallinn
Africa/Mbabane America/Montevideo Asia/Magadan Europe/Tirane
Africa/Mogadishu America/Montreal Asia/Makassar Europe/Uzhgorod
Africa/Monrovia America/Montserrat Asia/Manila Europe/Vaduz
--More--^C
�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
^P^?"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ^P�"^TxU ��"^TxU ��"^TxU
0�"^TxU ��"^TxU ��"^TxU ^P�"^TxU
0�"^TxU ��"^TxU ��"^TxU @�"^TxU
By the way my SIGINT
handler function is as below, and I am using rl_attempted_completion_function
to register my own function to provide possible completion strings char**
.
rl_initialize();
printf("\n");
rl_forced_update_display();
How to make Ctrl+C
to behave exactly as pressing q
on pagination?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论