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

"Option not supported" when paging the contents of Kitty buffer #265

Open
Hubro opened this issue Aug 18, 2022 · 5 comments
Open

"Option not supported" when paging the contents of Kitty buffer #265

Hubro opened this issue Aug 18, 2022 · 5 comments
Assignees
Labels

Comments

@Hubro
Copy link

Hubro commented Aug 18, 2022

I'm using this keybind with Kitty:

map f1 launch --stdin-source=@screen_scrollback --type=overlay --stdin-add-formatting vimpager

This causes errors when vimpager starts:

Error detected while processing function AnsiEsc#AnsiEsc:
line  505:
E519: Option not supported: hl=8:Ignore,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:S
earch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFoldr:Question,s:Status
Line,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,
D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:Pme
nuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,0:Whitespace,I:NormalNC
Press ENTER or type command to continue
@rkitover
Copy link
Owner

I use kitty too, I'll take a look.

@rkitover rkitover self-assigned this Aug 18, 2022
@rkitover rkitover added the bug label Aug 18, 2022
@rkitover
Copy link
Owner

The AnsiEsc support, to be honest, is only meant for simple things like Git diffs. And I haven't looked at or updated the version I have in many years. Dunno right now I'm going to do that soon, this project needs a lot of work in general.

If you don't really need AnsiEsc support, you can try turning it off with:

let g:vimpager.ansiesc = 0

.

I will look at whatever the bug is here a bit later.

@rkitover
Copy link
Owner

I tried your mapping, and it does run for me, although the AnsiEsc output is not ideal.

Did you install a different version of AnsiEsc with Plug or pathogen or something? Is your vim recent?

@Hubro
Copy link
Author

Hubro commented Aug 18, 2022

Did you install a different version of AnsiEsc with Plug or pathogen or something? Is your vim recent?

I'm using NVIM v0.7.2, I just installed "rkitover/vimpager" using vim-plug. I haven't installed AnsiEsc separately.

It does "kind of" work for me too, after I move past the error:

image

image

Disabling ANSI support wouldn't be very useful, as it's really the only reason I'm trying vimpager 😅 Otherwise I would just pipe to nvim -, which is my current solution[1]. I'm just really tired of the terminal turning black/white any time I do. I'm basically trying to replicate the scrollback experience in Alacritty, which lets me scroll, select and copy from the history buffer using Vim keybindings.


  • [1] map f1 launch --stdin-source=@screen_scrollback --type=overlay nvim - -m -n + +"set nornu" +"set nonu" +"set bt=nofile"

@rkitover
Copy link
Owner

Disabling ANSI support wouldn't be very useful, as it's really the only reason I'm trying vimpager 😅

The ANSI support in vimpager is generally very broken and is only meant for simple things like Git diffs/colordiff/etc.. As far as highlighting goes, the point of vimpager is to use Vim's powerful filetype detection and syntax highlighting support.

I haven't worked on this project in a while, but I might look into updating AnsiEsc in case it has gotten any better and/or fixing some things in it. Maybe there are better solutions now too, I may do some research. I'm not optimistic about this however and I'm not promising anything. AnsiEsc is a giant horrible hack, which I made even worse in my copy.

I'm basically trying to replicate the scrollback experience in Alacritty, which lets me scroll, select and copy from the history buffer using Vim keybindings.

Have you considered using the tmux scrollback support with something like:

set-window-option -g mode-keys vi

bind-key Escape copy-mode

# Add shift-page<up/down> bindings for scrolling.
bind-key -T root         -n S-PPage copy-mode -u
bind-key -T copy-mode-vi -n S-PPage send-keys -X page-up
bind-key -T copy-mode-vi -n S-NPage send-keys -X page-down

# Increase copy-mode buffer size.
set-option -g history-limit 300000

. This may give you most of what you want, you can copy and paste from the scrollback as well. This is from the tmux config I maintain here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants