willothy / wezterm.nvim

Utilities for interacting with Wezterm from within Neovim
189 stars 10 forks source link

Split pane function doesn't take cwd option #3

Closed cmygray closed 1 year ago

cmygray commented 1 year ago

I'd like to pass vim current dir to function like this:

nnoremap <C-w>V :lua require('wezterm').split_pane.horizontal({ cwd = 'CURRENT_DIR' })<CR>
nnoremap <C-w>V :lua require('wezterm').exec({'split_pane', '--right', '--cwd', 'CURRENT_DIR'})<CR>

But both two functions doesn't allow. (I think exec doesn't work passing split_pane) What do you think about it?

willothy commented 1 year ago

I'll look into the split_pane issue and try to get a fix in for that soon :)

For the second line, you need to use cli split-pane. exec is just a wrapper around the wezterm executable, and split-pane is namespaced under the cli subcommand. So this should work until I have the issue fixed:

nnoremap <C-w>V :lua require('wezterm').exec({ 'cli', 'split-pane',  '--right', '--cwd', 'CURRENT_DIR'})<CR>
cmygray commented 1 year ago

Exact. Thanks 🙂