oni icon indicating copy to clipboard operation
oni copied to clipboard

Start bash by default in Windows 10 when running :term?

Open superDuperCyberTechno opened this issue 8 years ago • 5 comments

Is it possible to edit what Oni executes upon running :term? Right now it simply runs cmd, but since I use bash exclusively, it's a little frustrating to always run bash as the first thing when opening a new terminal window.

superDuperCyberTechno avatar Apr 01 '18 20:04 superDuperCyberTechno

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Apr 01 '18 20:04 oni-bot

@superDuperCyberTechno its possible to open the terminal via the command palette which is set to use bash by default however if you use the term command you are communicating directly with neovim.

The best way to set this default is in your init.vim if you set shell="bash" (I would crosscheck the setting using :h shell I can't remember off the top of my head exactly if it should just be bash or /path/to/bash)

akinsho avatar Apr 01 '18 21:04 akinsho

Thanks!

superDuperCyberTechno avatar Apr 03 '18 07:04 superDuperCyberTechno

@superDuperCyberTechno I added this instruction to https://github.com/onivim/oni/wiki/Installation-Guide, let us know if there are other quirks for windows.

badosu avatar Apr 03 '18 13:04 badosu

I'm not sure if something like this would be wanted in Oni itself as a plugin, but I have a terminal selector at the moment using the Oni menus + some functions in my init.vim. Could probably extend the existing simple Oni version to do something similar, but haven't look into it yet.

The Oni side can be found here : https://github.com/CrossR/dotfiles/blob/1378bb94bfb3363e27b91f9b3c5a62540f79f9c6/oni/config.tsx#L53-L81

The init.vim side can be found here : https://github.com/CrossR/dotfiles/blob/1378bb94bfb3363e27b91f9b3c5a62540f79f9c6/neovim/.config/nvim/init.vim#L98-L163

Terminals I use : https://github.com/CrossR/dotfiles/blob/1378bb94bfb3363e27b91f9b3c5a62540f79f9c6/oni/config.tsx#L139-L147

That then gives me: image

If I select bash I get a 15 line high split as so: image

On select it pops up at the bottom and I use <LEADER>, to hide it. <LEADER>, shows it again, so I can pop it up, run a command, and then hide it again.

Found it useful when Oni uses powershell for npm, my C++ work uses bash and my Python work uses anaconda.

CrossR avatar Apr 03 '18 13:04 CrossR