Open nghialm269 opened 5 years ago
Hey, apologies for resurrecting a year old issue but I landed in here after running into the same issue.
This is caused because alacritty expects a value to be passed when using the --working-directory
flag, this error is likely swallowed and not presented in the buffer.
To get this to work set the unix
value as so:
let g:gtfo#terminals = { 'unix': 'alacritty --working-directory $(pwd -P) &' }
Hope it helps!
Hey, apologies for resurrecting a year old issue but I landed in here after running into the same issue.
This is caused because alacritty expects a value to be passed when using the
--working-directory
flag, this error is likely swallowed and not presented in the buffer.To get this to work set the
unix
value as so:let g:gtfo#terminals = { 'unix': 'alacritty --working-directory $(pwd -P) &' }
Hope it helps!
Hi, thanks for leaving a comment here, I just try your suggestion, it indeed doesn't block the neovim instance anymore, but it opens alacritty in the working directory (the one where I launched neovim), not the current file's containing directory.
Is there anyway to get the current file's directory and pass it to alacritty instead of $(pwd -P)?
@gbonfant thanks, I managed to make it work now:
nnoremap <silent> got :call <SID>gtfo_terminal()<CR>
function! s:gtfo_terminal()
let g:gtfo#terminals = { 'unix': 'alacritty --working-directory ' . expand("%:p:h") . ' &' }
call gtfo#open#term("%:p:h", "")
endfunction
I don't know viml
so maybe there is a better way to do this.
let g:gtfo#terminals = { 'unix': 'alacritty --working-directory ' . expand("%:p:h") . ' &' }
should probably add this and other terminal variants to the readme. Though g:gtfo#terminals
needs to be reworked in general...
Hi, sorry for necro bump, but i guess following could help someone like me.
LINUX ONLY SOLUTION
works with both (got & goT) mappings
Using linux utility from util-linux package setsid -f
- Always create a new process.
let g:gtfo#terminals = { 'unix': 'setsid -f alacritty --working-directory ' } " works both (got & goT)
I configured
gtfo
to launchalacritty
like this:let g:gtfo#terminals = { 'unix': 'alacritty --working-directory' }
When I type
got
, my neovim (alacritty) hangs and another alacritty instance shows up at the current file's directory. When I close this alacritty instance, the one with neovim start to work again.Is there anyway to make
got
spawns terminal in the background so that neovim doesn't hang?I tried:
let g:gtfo#terminals = { 'unix': 'alacritty & --working-directory' }
, neovim doesn't hang but the shell is started in $HOME instead of the file's containing directory.let g:gtfo#terminals = { 'unix': 'alacritty --working-directory &' }
, nothing starts.