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

'got' causes alacritty to hang #50

Open
nghialm269 opened this issue Jun 2, 2019 · 5 comments
Open

'got' causes alacritty to hang #50

nghialm269 opened this issue Jun 2, 2019 · 5 comments
Labels

Comments

@nghialm269
Copy link

I configured gtfo to launch alacritty 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.

@justinmk justinmk added the bug label Jun 2, 2019
@levriero
Copy link

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!

@nghialm269
Copy link
Author

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)?

@nghialm269
Copy link
Author

@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.

@justinmk justinmk added question and removed bug labels Aug 30, 2020
@justinmk
Copy link
Owner

  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...

@WANDEX
Copy link

WANDEX commented Dec 24, 2020

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)

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

No branches or pull requests

4 participants