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

feat: Kitty multiplexer backend support #50

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

mrjones2014
Copy link
Owner

Fixes: #49

@mrjones2014
Copy link
Owner Author

@primeapple Please give this a test.

@mehalter
Copy link

mehalter commented Apr 3, 2023

@mrjones2014 thanks for this! I gave it a shot and get this error when trying to switch to a split in kitty. I can switch between my neovim splits just fine

2023-04-03T13:47:20  ERROR [smart-splits.nvim] Failed to get multiplexer pane ID  

@mrjones2014
Copy link
Owner Author

@mehalter what Kitty version are you using and did you set it up to allow remote commands? https://github.com/mrjones2014/smart-splits.nvim/pull/50/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R334

I can't reproduce your issue.

@mehalter
Copy link

mehalter commented Apr 3, 2023

Yeah I am, I am actually trying to move directly from https://github.com/knubie/vim-kitty-navigator

@mrjones2014
Copy link
Owner Author

can you paste the output (removing anything sensitive, if there is anything) of kitty @ ls when you have multiple kitty splits open?

@mehalter
Copy link

mehalter commented Apr 3, 2023

This is with a single vertical split:

[
  {
    "id": 1,
    "is_active": true,
    "is_focused": true,
    "last_focused": true,
    "platform_window_id": 92274702,
    "tabs": [
      {
        "active_window_history": [
          1,
          2
        ],
        "enabled_layouts": [
          "splits:split_axis=horizontal"
        ],
        "id": 1,
        "is_active": true,
        "is_focused": true,
        "layout": "splits",
        "layout_opts": {
          "default_axis_is_horizontal": true
        },
        "layout_state": {
          "pairs": {
            "bias": 0.5,
            "horizontal": true,
            "one": 1,
            "two": 2
          }
        },
        "title": "kitty @ ls",
        "windows": [
          {
            "cmdline": [
              "/bin/zsh"
            ],
            "columns": 43,
            "cwd": "/home/micah",
            "env": {
              "KITTY_WINDOW_ID": "1"
            },
            "foreground_processes": [
              {
                "cmdline": [
                  "kitty",
                  "@",
                  "ls"
                ],
                "cwd": "/home/micah",
                "pid": 951868
              }
            ],
            "id": 1,
            "is_active": true,
            "is_focused": true,
            "is_self": true,
            "lines": 68,
            "pid": 951508,
            "title": "kitty @ ls"
          },
          {
            "cmdline": [
              "/bin/zsh"
            ],
            "columns": 43,
            "cwd": "/home/micah",
            "env": {
              "KITTY_WINDOW_ID": "2"
            },
            "foreground_processes": [
              {
                "cmdline": [
                  "/bin/zsh"
                ],
                "cwd": "/home/micah",
                "pid": 951621
              }
            ],
            "id": 2,
            "is_active": false,
            "is_focused": false,
            "is_self": false,
            "lines": 68,
            "pid": 951621,
            "title": "~"
          }
        ]
      }
    ],
    "wm_class": "kitty",
    "wm_name": "kitty"
  }
]

@mrjones2014
Copy link
Owner Author

Ah, probably a difference in Kitty version then. My code is currently looking for tab.is_active_tab but your output shows just tab.is_active. I'll update to check for both so it works for both Kitty versions.

@mehalter
Copy link

mehalter commented Apr 3, 2023

Ah yeah that makes sense, I am using kitty 0.27.1 created by Kovid Goyal I believe this is the latest version

@mrjones2014
Copy link
Owner Author

@mehalter please give it another shot if you don't mind, thanks 🙂

@mehalter
Copy link

mehalter commented Apr 3, 2023

Dang, I hate to be a nuisance here LOL but I'm getting the same error :(

@mrjones2014
Copy link
Owner Author

Dang, I hate to be a nuisance here LOL but I'm getting the same error :(

Not a nuisance at all, I want to get it working 🙂

I updated my Kitty version and can reproduce now, so it should be easier to debug on my end.

@mrjones2014
Copy link
Owner Author

@mehalter I had a typo -- try one more time please?

@mehalter
Copy link

mehalter commented Apr 3, 2023

Works perfectly! Thanks @mrjones2014 !

@primeapple
Copy link

Holy guacamole. This was fast.

Will try it in the following days. You might shorten the copied Readme a bit ;-)

Btw: When using the split layout ( https://sw.kovidgoyal.net/kitty/layouts/#the-splits-layout ) in Kitty, it should be possible to work out resizing and paneswapping ;-)

@mrjones2014
Copy link
Owner Author

Btw: When using the split layout ( https://sw.kovidgoyal.net/kitty/layouts/#the-splits-layout ) in Kitty, it should be possible to work out resizing and paneswapping ;-)

As mentioned here: https://sw.kovidgoyal.net/kitty/layouts/#window-resizing

The window resizing API in Kitty is not directional, it's "taller"/"shorter"/"wider"/"narrower" so directional resizing won't work.

@mrjones2014 mrjones2014 merged commit 6027452 into master Apr 3, 2023
@mrjones2014 mrjones2014 deleted the mrj/49/kitty-multiplexer-support branch April 3, 2023 18:43
@osleg
Copy link

osleg commented Apr 4, 2023

kitty/active_pane.py file is listed in install script but missing from the PR

@mrjones2014
Copy link
Owner Author

Thanks for calling that out -- I've removed that line from the install script.

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

Successfully merging this pull request may close these issues.

[FEATURE]: Integrate Kitty Multiplexer as strategy
4 participants