Ticket #4080 (new defect)

Opened 14 months ago

Last modified 6 months ago

Enable bash-completion

Reported by: cri Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Would it be possible to enable bash-completion (https://github.com/scop/bash-completion) in the mc panels command line? Currently it only works when in the subshell (Ctrl-O).

Change History

comment:1 Changed 13 months ago by cri

To be extra-clear, I mean what in bash(1) is called "Programmable Completion", usually enabled by sourcing /usr/share/bash-completion/bash_completion (I even tried doing it explicitely on the mc command line widget but no effect).

I guess it's a matter of adding support for it in lib/widget/input_complete.c, right? Do you think this is feasible?

comment:2 Changed 6 months ago by cri

Ping. Any hints? I'd be glad to help with this if anyone could point me in the right direction...

comment:3 follow-up: ↓ 4 Changed 6 months ago by ossi

well, now that bi-directional syncing of the shell prompt was implemented, this might be even realistic.
mc would still have to catch and present the completion prompts generated by the shell, so this is likely going to be a non-trivial amount of work.
but then, given that the syncing is there now, the marginal gain of implementing this would be rather low - you can just turn off the panels for a moment to invoke the shell completion.

comment:4 in reply to: ↑ 3 Changed 6 months ago by cri

Replying to ossi:

well, now that bi-directional syncing of the shell prompt was implemented, this might be even realistic.

Oh, you mean #4114, right? That actually slightly improves the situation, thanks.

mc would still have to catch and present the completion prompts generated by the shell, so this is likely going to be a non-trivial amount of work.

:(

you can just turn off the panels for a moment to invoke the shell completion.

Uhm, I wonder if this can be somehow automated. I.e. pressing Tab (I redefined Tab for completion instead of Esc-Tab) on the panels command line would automatically switch to the subshell, pass the tab key to it, so that bash-completion would be invoked, and then go back to the panels after auto-completion is done. But I guess the last step is the trickiest, right? And maybe it would be visually uncomfortable, the eye should jump from the panels command line at bottom of the screen to the subshell command line at the top, and back...

comment:5 Changed 6 months ago by zaytsev

Yeah, that's what is basically meant with non-trivial amount of work...

Note: See TracTickets for help on using tickets.