page icon indicating copy to clipboard operation
page copied to clipboard

panic after configuring MANPAGER on macOS

Open hakamadare opened this issue 3 years ago • 1 comments

$ brew info page
page: stable 3.1.2 (bottled), HEAD
Use Neovim as pager
https://github.com/I60R/page
/usr/local/Cellar/page/3.1.2 (7 files, 1.9MB) *
  Poured from bottle on 2022-07-28 at 11:02:00
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/page.rb
License: MIT
==> Dependencies
Build: rust ✔
Required: neovim ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 0 (30 days), 0 (90 days), 0 (365 days)
install-on-request: 0 (30 days), 0 (90 days), 0 (365 days)
build-error: 0 (30 days)
$ nvim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.7.2_1/share/nvim"

Run :checkhealth for more info
$ export MANPAGER="page -t man"
$ export RUST_BACKTRACE=full
$ man ls
thread 'main' panicked at 'Cannot open PTY device: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/pager/main.rs:1077:26
stack backtrace:
   0:        0x108d35488 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8926cb4beb3306db
   1:        0x108ca2b3a - core::fmt::write::hc1f18fa3b50c7c9d
   2:        0x108d1a63c - std::io::Write::write_fmt::h6b9f4c342a0c9249
   3:        0x108d1f94d - std::panicking::default_hook::{{closure}}::h45609ee8da44383a
   4:        0x108d1f611 - std::panicking::default_hook::h147f83b3ed514383
   5:        0x108ce6cd6 - page::_init_panic_hook_::{{closure}}::h517300c10dea861b
   6:        0x108d20407 - std::panicking::rust_panic_with_hook::h06323e959c8054b4
   7:        0x108d35c84 - std::panicking::begin_panic_handler::{{closure}}::h0246d09db197196c
   8:        0x108d35bf9 - std::sys_common::backtrace::__rust_end_short_backtrace::h674a492f79294b55
   9:        0x108d1fd85 - _rust_begin_unwind
  10:        0x108d5a9d3 - core::panicking::panic_fmt::haf68904a070dc633
  11:        0x108d5ab85 - core::result::unwrap_failed::h3caffab0fad93818
  12:        0x108ce1db0 - page::output_buffer_usage::BufferActions::get_buffer_pty::h730d0e975617b8ba
  13:        0x108c44ffa - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hf28c2bb7eff0e42f
  14:        0x108c4a4ae - page::manage_output_buffer::{{closure}}::h67f41b37e6e8a223
  15:        0x108c33ad4 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h55945aab528942fe
  16:        0x108c422ec - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he1f6a73537156b6b
  17:        0x108ce90d7 - page::main::hbf83097d654ff3e3
  18:        0x108cc67a6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0443fd823b3692c9
  19:        0x108ce710a - _main

This behavior persists even after I move aside my init.vim, so that makes me more confident that I haven't broken something with my config. It also persists when running under kitty (TERM=xterm-kitty) and iTerm2 (TERM=xterm-256color).

Is there other useful troubleshooting information I can provide?

hakamadare avatar Jul 28 '22 16:07 hakamadare

I'm having the same panic happen when I try to pipe output into page on macOS. Same error coming from the same spot in the code main.rs:1077:26.

I'm on macOS 12.5, kitty 0.25.2

My guess is that this is a mac specific issue

EDIT: I upgraded to macOS 12.5.1 and still no luck.

Oddly, accessing the man-pages with this function is the only thing I can get page to do without the panic.

Too bad for now I guess, nvimpager it is.

fathergoose avatar Aug 24 '22 20:08 fathergoose

Sorry, I'm having no access to MacOS and don't know what's going on. But fix might be trivial, could you test on lastest master commit?


Edit: you can also try this binary from Github Actions Artifacts: page-macos.zip

I60R avatar Nov 15 '22 14:11 I60R

Due to inactivity in this issue I assume page works as expected after fix

I60R avatar Dec 03 '22 12:12 I60R