nikvdp / neomux

Control Neovim from shells running inside Neovim.
MIT License
350 stars 11 forks source link

Config option to disable confirmation for `g:neomux_start_term_*map` keys #17

Closed jeffmo closed 1 year ago

jeffmo commented 1 year ago

I wanted the ability to just open a terminal rather than having to hit ENTER each time I used C-w + [t,T]:

Screenshot 2023-04-01 at 9 49 04 AM

This PR adds a config option to enable skipping this confirmation by tacking an additional <CR> to the end of the commands run by those mapped keys.

Does this seem like a reasonable thing to upstream?

nikvdp commented 1 year ago

Hi @jeffmo, thanks for the PR! I think the press Enter or type command to continue message you're seeing may be specific to your vim setup, normally neomux doesn't show a confirmation message when opening a new term window with the cmd w+t mappings.

Can you give some of the fixes suggested here a try and see if one of them resolves the issue?

If not then let's go ahead and merge this, but name the option something like neomux_double_confirm_fix and update the docs to mention that this is a workaround for unexpected behavior in some setups

jeffmo commented 1 year ago

Interesting! I have an autocmd CmdlineExit that sets cmdheight=0 to hide the command bar after typing a command (and a corresponding autocmd CmdlineEnter to set cmdheight=1). When I delete that autocmd CmdlineExit, the press-enter behavior goes away.

Searching around a bit I found this.

I haven't spent time to deeply understand the underlying issue there yet (limited time) but it seems very likely related. I see a comment that this PR claims to fix some aspect of that issue, but it's not merged yet.

If that seems like a reasonable argument for moving forward, I'm happy to tweak the option's name to neomux_double_confirm_fix as you suggested (although I see "hit-enter" is apparently a common term for this message I'm seeing -- would neomux_hitenter_fix be a better name? No strong opinions here :) )

nikvdp commented 1 year ago

Sounds like a plan, let's do it!

nikvdp commented 1 year ago

it's in!