monsanto / readline-complete.el

autocomplete in shell mode buffers
67 stars 16 forks source link

removing --noediting from explicit-bash-args causes quoted tab characters to be stripped #6

Closed ian-kelling closed 9 years ago

ian-kelling commented 10 years ago

The readline-complete.el instructions say (setq explicit-bash-args '("-c" "export EMACS=; stty echo; bash")) the default value is '("--noediting" "-i")

The removal of --noediting causes tabs to be striped from input, and the input string is also printed.

between the oks should be a tab. It appears github replaces it with spaces.

$ echo "ok  ok" 
echo "okok"
okok

the result should be

$ echo "ok   ok"
ok      ok
ian-kelling commented 10 years ago

And disabling my bashrc and inputrc, i get

$ echo "ok  ok"
echo "ok^Gok"
okok
monsanto commented 10 years ago

I'm not entirely sure about what you're saying, so correct me if necessary.

First, --noediting is definitely not allowed to be in the arglist, that disables readline.

Second, readline-complete, when installed correctly, does not have the capability to render tabs differently on your screen. When you call the get completions command (rlc-candidates), it changes the process filter, sends the 'list' command to readline, and changes the process filter back. The only time your process filter is not the default is during this time.

Therefore, if tabs aren't being rendered correctly, the problem must lie with either shell-mode or comint-mode. Perhaps peruse the settings, or file a bug report with the Emacs maintainers?

ian-kelling commented 10 years ago

Right, I don't think this is not a bug in readline-complete. It's just related, because it happens with a setting that readline-complete needs. Perhaps you might be able to help me figure it out a bit though. When I remove --noediting, and do not enable readline-complete, the bug happens, and also every command is echod back. When I enable readline-complete, the bug happens, and only commands which have a tab in, which have this bug, are echod back.

ian-kelling commented 10 years ago

I filed the bug a bit prematurely, sorry about that. I am investigating it.

ian-kelling commented 10 years ago

Yes, this bug has nothing to do with readline-complete, except that it's affected by it. Please close this. I'm still figuring out if it is in shell or comint mode.

ian-kelling commented 10 years ago

I figured it out. Readline was grabbing the tab chars and inserting whatever resulted from executing the tab binding. So entering cd would result in printing completions for cd. To fix it, I rebound the tab character. Rebinding it can fix it:

bind '"\C-i": self-insert'

I would like readline-complete.el to document this with its other comments about readline settings. I will write a patch for the comment unless you would rather do it.

monsanto commented 10 years ago

@ian-kelling You know more about this than I do--if you write a patch I'll merge it in

ian-kelling commented 10 years ago

Dunno if you missed it, but there's an open pull request.

monsanto commented 10 years ago

Sorry @ian-kelling -- I'll merge your doc note.