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

bug: Neovim nightly ERROR alternate file not found vim.fn.bufnr('#') is -1. Most likely jobstart failed #303

Closed
Darvinleo opened this issue Jan 19, 2025 · 8 comments · Fixed by #307
Labels
bug Something isn't working released

Comments

@Darvinleo
Copy link

Darvinleo commented Jan 19, 2025

Don't sure what exactly went wrong after my update of apt packages, LazyVim plugins, but now i've got this error if i am trying to open kittyscrollback buffer (same for tmux and usual kitty buffer ).

In kittyhealthcheck nothing suspicious...
Help please to make this greatest plugin ever work again!)

 kitty-scrollback.nvim                                                                                                                                                                       
                                                                                                                                                                                               
   A fatal error occurred                                                                                                                                                                      
   - ERROR alternate file not found                                                                                                                                                            
     vim.fn.bufnr('#') is -1. Most likely jobstart failed.                                                                                                                                     
     Please report the issue at https://github.com/mikesmithgh/kitty-scrollback.nvim/issues                                                                                                    
     and provide the KittyScrollbackCheckHealth report.     

==============================================================================
kitty-scrollback: require("kitty-scrollback.health").check()

kitty-scrollback: Neovim version 0.9+ ~

  • OK NVIM 0.11.0-dev

kitty-scrollback: kitty-scrollback.nvim version ~

  • OK /___/| kitty-scrollback.nvim @ 56399db
    =) ^Y^ (=
    \ ^ / If you have any issues or questions using kitty-scrollback.nvim then
    )=*=( please create an issue at
    / \ https://github.com/mikesmithgh/kitty-scrollback.nvim/issues and
    | | provide the KittyScrollbackCheckHealth report.
    /| | | |\
    | | _|/
    /_// ___/ Bonus points for cat memes
    _)

kitty-scrollback: Kitty remote control ~

  • OK kitty @ ls exited with code 0

kitty-scrollback: Kitty data ~

  • OK Kitty data available

    lua
    {
    columns = 191,
    cursor_x = 94,
    cursor_y = 5,
    kitty_config_dir = "/home/user/.config/kitty",
    kitty_opts = {
    allow_remote_control = "yes",
    listen_on = "unix:/tmp/kitty",
    scrollback_fill_enlarged_window = false,
    scrollback_lines = 3000,
    scrollback_pager = { "less", "--chop-long-lines", "--RAW-CONTROL-CHARS", "+INPUT_LINE_NUMBER" },
    scrollback_pager_history_size = 0,
    shell_integration = "enabled"
    },
    kitty_path = "/home/user/.local/kitty.app/bin/kitty",
    kitty_scrollback_config = "ksb_builtin_checkhealth",
    kitty_version = { 0, 35, 2 },
    ksb_dir = "/home/user/.local/share/nvim/lazy/kitty-scrollback.nvim",
    lines = 45,
    scrolled_by = 0,
    shell = "/usr/bin/zsh",
    tmux = vim.empty_dict(),
    window_id = 1,
    window_title = "tmux"
    }

kitty-scrollback: Kitty version 0.32.2+ ~

  • OK kitty 0.35.2

kitty-scrollback: clipboard ~

  • OK Clipboard tool found: xsel

kitty-scrollback: sed ~

  • OK sed -E -e s/\r//g -e s/$/\x1b[0m/g exited with code 0 and stdout expected�[0m
    sed: /usr/bin/sed
@shaungarwood
Copy link

shaungarwood commented Jan 19, 2025

+1
kitty scrollback @ 56399db
kitty version: 0.39.0
nvim version: 0.11.0-dev
os: ubuntu 24.10 (sway - wayland)

Thanks in advance!!

@mikesmithgh
Copy link
Owner

Hi @shaungarwood and @Darvinleo I see you are on nightly. There was a change that was introduced in newer versions of nightly related to termopen and jobstart. Could you try upgrading to the latest version of nightly and let me know if the issue still occurs? You can also pin an older version of kitty-scrollback.nvim as a workaround. See #282 (comment) for more details.

@mikesmithgh mikesmithgh added the bug Something isn't working label Jan 19, 2025
@mikesmithgh mikesmithgh changed the title ERROR alternate file not found vim.fn.bufnr('#') is -1. Most likely jobstart failed bug: Neovim nightly ERROR alternate file not found vim.fn.bufnr('#') is -1. Most likely jobstart failed Jan 19, 2025
@shaungarwood
Copy link

good call! My nvim version was stuck in purgatory after upgrading ubuntu because there isn't a PPA for Oracular yet. I was forced to downgrade to 10.3 (via brew) and kitty-scrollback works great now! Thanks @mikesmithgh

@Darvinleo
Copy link
Author

Could you try upgrading to the latest version of nightly
On the latest nvim nightly - same error.

NVIM v0.11.0-dev-1589+g71507281fb
Build type: RelWithDebInfo
LuaJIT 2.1.1736781742

I've pin an kitty-scrollback to 6.1.2 - and it's works now! Thx a lot)
Will watch on this issue and unpin after fix

@mikesmithgh
Copy link
Owner

Sounds good.

Once #304 is merged, an improved error message will be provided 👍.

improved error message

Background on this issue:

Neovim nightly deprecated termopen in favor of jobstart. See neovim/neovim#31343

If you are using Neovim nightly on a version that hasn't implemented the updates to jobstart, then you will see the error related to alternate file not found. To fix this problem, update to the latest version of Neovim nightly.

If you cannot update to the latest version of Neovim nightly, the workaround is to pin kitty-scrollback.nvim v6.1.2.

For example, if you are using lazy.nvim

return {
  {
    'mikesmithgh/kitty-scrollback.nvim',
    tag = 'v6.1.2',
    enabled = true,
    lazy = true,
    cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth', 'KittyScrollbackGenerateCommandLineEditing' },
    event = { 'User KittyScrollbackLaunch' },
    -- version = '*', -- latest stable version, may have breaking changes if major version changed
    -- version = '^6.0.0', -- pin major version, include fixes and features that do not have breaking changes
    config = function()
      require('kitty-scrollback').setup()
    end,
  },
}

I plan to leave this issue open to help users when they encounter this error. I will close this issue after a long period of inactivity or once Neovim v0.11 is released.

@mikesmithgh
Copy link
Owner

actually just found a workaround for this thanks to fzf-lua :) ibhagwan/fzf-lua#1732

I'll plan to fix this later today.

@mikesmithgh
Copy link
Owner

once #305 is merged this will be fixed and I'll close this issue 👍

mikesmithgh pushed a commit that referenced this issue Jan 20, 2025
## [6.2.2](v6.2.1...v6.2.2) (2025-01-20)

### Bug Fixes

* add workaround for jobstart issues on nvim nightly ([#305](#305)) ([#307](#307)) ([a74948a](a74948a)), closes [#303](#303)
@mikesmithgh
Copy link
Owner

🎉 This issue has been resolved in version 6.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants