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

Method of clearing commandline is rather hacky #11

Closed
brettanomyces opened this issue Jan 25, 2016 · 1 comment
Closed

Method of clearing commandline is rather hacky #11

brettanomyces opened this issue Jan 25, 2016 · 1 comment

Comments

@brettanomyces
Copy link
Owner

Because terminal buffers are 'nomodifiable' clearing the commandline after we have extracted the command is a bit of a hack.

The only way I've found that works is to have the keypresses required directly inside of the mapping (or having them inside a macro which is called directly from the mapping).

Extracting them into their own function does not work.
execute 'normal!...' does not work.
'feedkeys()' cannot be used because it does not run till the script has completed.

If we had the job id of the terminal then we could do call jobsend(id, "^C") but I'm unsure if terminals started using :terminal even get a job id.

call termopen('/usr/local/bin/fish') does return a job id so it could be used but then users would need to start their terminals via my plugin somehow, currently the plugin works regardless of how the terminal was started.

@brettanomyces
Copy link
Owner Author

I've created https://github.com/brettanomyces/nvim-terminus which uses job control to implement similar functionality to this plugin, without the hack. Unfortunately it requires the user to open the terminal using a command provided by the plugin so its a bit of a tradeoff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant