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

[Feature]: Improve mux auto-detection and make lookup more flexible #141

Open
1 task done
mrjones2014 opened this issue Dec 15, 2023 · 0 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@mrjones2014
Copy link
Owner

Similar Issues

  • Before filing, I have searched for similar issues.

Description

Recently there's been an increase in issues related to mux auto-detection, and an interesting use-case in #140. Using tmux in other terminals, but kitty mux in kitty.

Mux auto-detection needs to be made more robust, and we also need to make the priority order configurable, so that e.g. if tmux is installed and you're using kitty, but you want to use kitty mux in the kitty terminal, you can specify that kitty should take precedence here.

I'm thinking we can do something like:

local mux_lookup = {
  tmux = function()
    local term = vim.trim((vim.env.TERM_PROGRAM or ''):lower())
    return term == 'tmux'
  end,
  wezterm = function()
    local term = vim.trim((vim.env.TERM_PROGRAM or ''):lower())
    return term == 'wezterm'
  end,
  kitty = function()
    return vim.env.KITTY_LISTEN_ON ~= nil and #vim.env.KITTY_LISTEN_ON > 0
  end,
}

And then the config would be something like:

require('smart-splits').setup({
  mux_detection_priority = { 'tmux', 'wezterm', 'kitty' },
})
@mrjones2014 mrjones2014 added the enhancement New feature or request label Dec 15, 2023
@mrjones2014 mrjones2014 self-assigned this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant