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

Can't background an FTerm terminal running k9s #84

Open
jessebot opened this issue Mar 11, 2023 · 0 comments
Open

Can't background an FTerm terminal running k9s #84

jessebot opened this issue Mar 11, 2023 · 0 comments

Comments

@jessebot
Copy link

jessebot commented Mar 11, 2023

Thanks for maintaining FTerm.nvim! It's a really cool project :)

I use k9s to monitor my kubernetes clusters in the terminal, and was previously using nvim-k8s to launch a floating window in neovim with k9s running in it. I wanted to consolidate my plugins and use fterm for k9s instead, because nvim-k8s is not actively maintained right now anyway. Here's what I put together in my lua config:

local fterm = require("FTerm")

-- must install k9s in advance, see: https://k9scli.io/topics/install/
local k9s = fterm:new({
    ft = 'fterm_k9s',
    cmd = "k9s",
    dimensions = {
        height = 0.9,
        width = 0.9
    }
})

-- Use this to toggle k9s in a floating terminal
-- first arg of 'n' is for normal mode in neovim
-- <A-b> are keys: Alt + b (alt is option on macOS)
vim.keymap.set('n', '<A-b>', function()
    k9s:toggle()
end)

Launching k9s in a floating terminal with Alt+b works fine, but I can't background it with the same key combination and I'm not sure why. I think k9s is capturing the key input, but I'm not really sure how to fix this. I know in nvim-k8s they used the keys Alt+p for toggling the floating window, and that worked fine, but I have no idea why it doesn't work for fterm.

I tried with Alt+p instead of the config above and I get the same result of it working for opening the terminal, but not for backgrounding it.

Do you have any ideas on how to solve this? It doesn't look like k9s is actually using Alt for anything according to their docs, so I'm a bit confused 🤔

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