You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project of mine, I wrote a completer function that does only return strdup("\t"); (to disable completion of filenames, which are meaningless for my project). However, this prints ^I instead of a tab as it should. When I try to return something like strdup("hello world"), it prints hello\ world instead. I assume that the issue is due to the very questionable implementation of CTL() and META(). It seems to me that the proper way of doing this is to use a type larger than a char, where the modifers are stored in higher bits. Of course this will require changing the public interface to libeditline, so maybe the current functions should be deprecated (but still remain), and new, proper functions should be added.
I just did some digging and found out that the string returned from my completer function is passed to insert_string(), which passes it to tty_string(), and then each character goes to tty_show(), which does use the ISCTL() and ISMETA() macros to incorrectly convert a tab into ^I. Also, it is line 1385 of editline.c which adds a newline before spaces. No idea why it does that though.
The text was updated successfully, but these errors were encountered:
Okay, I will do that for now, but I'm curious how you're supposed to complete a string that contains spaces without adding backslashes to them. That is still an issue I believe.
On Sep 25, 2015, at 2:48 AM, Joachim Nilsson [email protected] wrote:
If you want to disable TAB completion, simply add the following to your code:
rl_inhibit_complete = 1;
—
Reply to this email directly or view it on GitHub.
In a project of mine, I wrote a completer function that does only
return strdup("\t");
(to disable completion of filenames, which are meaningless for my project). However, this prints^I
instead of a tab as it should. When I try to return something likestrdup("hello world")
, it printshello\ world
instead. I assume that the issue is due to the very questionable implementation ofCTL()
andMETA()
. It seems to me that the proper way of doing this is to use a type larger than a char, where the modifers are stored in higher bits. Of course this will require changing the public interface to libeditline, so maybe the current functions should be deprecated (but still remain), and new, proper functions should be added.I just did some digging and found out that the string returned from my completer function is passed to
insert_string()
, which passes it totty_string()
, and then each character goes totty_show()
, which does use theISCTL()
andISMETA()
macros to incorrectly convert a tab into^I
. Also, it is line 1385 of editline.c which adds a newline before spaces. No idea why it does that though.The text was updated successfully, but these errors were encountered: