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

Enable bash-completion #4080

Open
mc-butler opened this issue May 6, 2020 · 5 comments
Open

Enable bash-completion #4080

mc-butler opened this issue May 6, 2020 · 5 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4080
Reporter cri (cri@….org)

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).

@mc-butler
Copy link
Author

Changed by cri (cri@….org) on May 9, 2020 at 15:58 UTC (comment 1)

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?

@mc-butler
Copy link
Author

Changed by cri (cri@….org) on Dec 3, 2020 at 15:04 UTC (comment 2)

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

@mc-butler
Copy link
Author

Changed by ossi (@ossilator) on Dec 3, 2020 at 15:41 UTC (comment 3)

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.

@mc-butler
Copy link
Author

Changed by cri (cri@….org) on Dec 4, 2020 at 10:06 UTC (comment 3.4)

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...

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Dec 5, 2020 at 15:57 UTC (comment 5)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant