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

glitches after opening new windows? #35

Open
0xGodspeed opened this issue Jul 29, 2021 · 30 comments
Open

glitches after opening new windows? #35

0xGodspeed opened this issue Jul 29, 2021 · 30 comments

Comments

@0xGodspeed
Copy link

0xGodspeed commented Jul 29, 2021

image
image
no idea what causes this
the patches i have enabled are:

alpha
anysize
anysize_nobar
boxdraw
clipboard
columns
font2
ligatures
newterm
openurlonclick
scrollback
scrollback_mouse
sixel
sync
w3m
xresources
xresources_reload
@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

This looks to be caused by the anysize patch.

I can replicate this by making the st terminal floating and resizing it vertically. It's a bit silly that it tries to center the content of the terminal, other terminals don't do this as far as I can see.

@0xGodspeed
Copy link
Author

so is there a fix for this?

@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

Try this, enabled via ANYSIZE_SIMPLE_PATCH. I don't understand why the anysize patch is so convoluted. I don't think you need the ANYSIZE_NOBAR_PATCH, but you can enable it if you observe any graphical issues.

@0xGodspeed
Copy link
Author

it works fine with anysize_simple_patch
also i just noticed another thing
whenever i exit neovim ;420;720t gets printed on the terminal
Peek 2021-07-29 20-06

@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

You are right, I see it as well.

It comes from the sixel patch, I am not entirely sure why it is needed:

    #if SIXEL_PATCH
    case 't':
        /* TODO should probably not be hard-coded */
        ttywrite(";420;720t", 10, 1);
        break;
    #endif // SIXEL_PATCH

@0xGodspeed
Copy link
Author

what is that case for?

@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

I don't know, I checked https://github.com/charlesdaniels/st and it's the same behaviour there.

Thankfully the commit comment has an explanation:
charlesdaniels/st@b50be82

@0xGodspeed
Copy link
Author

i also just realized sixel doesn't work in my terminal.
lsix doesn't display any images

bakkeby added a commit that referenced this issue Jul 29, 2021
	#if SIXEL_PATCH
	case 't':
		/* TODO should probably not be hard-coded */
		ttywrite(";420;720t", 10, 1);
		break;
	#endif // SIXEL_PATCH

This would result in printing ";420;720t" when exiting neovim.

Without this code a line is written to standard err instead:

erresc: unknown csi ESC[23;0t

The ttywrite was added as part of this commit:
   - charlesdaniels/st@b50be82

which states:

> When a S or T CSI escape was encountered, the lines which were scrolled
> away would be deleted from the scrollback buffer. This has been
> corrected - the lines are now preseved.
>
> This fixes a bug where issuing `clear` followed by `lsix` would cause
> the line on which the `lsix` was issued to disappear from the scrollback
> buffer.
>
> Note that the line may scroll out of view and thus dissapear, but it
> will now be preserved in the scrollback buffer.

Given that we could not reproduce the above bug without the ttywrite in
this case I am not convinced that this is actually needed. Leaving this
here in case this comes up again in the future.
@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

I removed the case, couldn't replicate the scenario about the scrollback buffer.

@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

As for sixel, you may want to try img2sixel as well. If it doesn't show anything then maybe double check that you indeed still have the SIXEL_PATCH enabled.

@0xGodspeed
Copy link
Author

img2sixel is in libsixel package right?
is there a binary for it? i dont know why but the aur package doesn't compile properly

@bakkeby
Copy link
Owner

bakkeby commented Jul 29, 2021

I'm not aware of a binary for it, I use the aur/libsixel installed using paru.

@0xGodspeed
Copy link
Author

i tried and img2sixel isn't working
i do have sixel_patch enabled

@bakkeby
Copy link
Owner

bakkeby commented Jul 30, 2021

I don't know then, maybe double check if sixel graphics is working in other terminals.

There's mlterm where this works out of the box (although the placement of the image is always at the top of the terminal window and is subject to cropping).

In xterm you can enable sixel support by adding this to your ~/.Xresources file:

xterm*decTerminalID : vt340

I must say I like how smooth the scrolling of images is in xterm.

@0xGodspeed
Copy link
Author

0xGodspeed commented Jul 30, 2021

yeah they work in xterm

@0xGodspeed
Copy link
Author

eh it's fine, i don't need sixel that much anyway
thanks for resolving everything else!

@schrmh
Copy link

schrmh commented Aug 3, 2021

@godspeedfw Yeah the current hint in the patches.def.h about removing lines to get SIXEL to work is a bit misleading.
I dunno why it was removed removed from the Makefile, but it will work if you add SIXEL_C = sixel.c sixel_hls.c like here (but to line 6):

st-flexipatch/Makefile

Lines 11 to 12 in 245c409

# Uncomment this for the SIXEL patch / SIXEL_PATCH
#SIXEL_C = sixel.c sixel_hls.c

I cloned the repo again, added that, run make and sudo make install and lsix just worked.

@0xGodspeed
Copy link
Author

nope, still doesn't work for me

@0xGodspeed 0xGodspeed reopened this Aug 5, 2021
@0xGodspeed
Copy link
Author

and I think it was removed because SIXEL_C is defined in config.mk which is included in the Makefile

@bakkeby
Copy link
Owner

bakkeby commented Aug 5, 2021

So what is in your config.mk?

@0xGodspeed
Copy link
Author

# st version
VERSION = 0.8.4

# Customize below to fit your system

# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

PKG_CONFIG = pkg-config

# Uncomment this for the alpha patch / ALPHA_PATCH
XRENDER = -lXrender

# Uncomment this for the themed cursor patch / THEMED_CURSOR_PATCH
#XCURSOR = -lXcursor

# Uncomment the lines below for the ligatures patch / LIGATURES_PATCH
LIGATURES_C = hb.c
LIGATURES_H = hb.h
LIGATURES_INC = `$(PKG_CONFIG) --cflags harfbuzz`
LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz`

# Uncomment this for the SIXEL patch / SIXEL_PATCH
SIXEL_C = sixel.c sixel_hls.c

# includes and libs, uncomment harfbuzz for the ligatures patch
INCS = -I$(X11INC) \
       `$(PKG_CONFIG) --cflags fontconfig` \
       `$(PKG_CONFIG) --cflags freetype2` \
       $(LIGATURES_INC)
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${XRENDER} ${XCURSOR}\
       `$(PKG_CONFIG) --libs fontconfig` \
       `$(PKG_CONFIG) --libs freetype2` \
       $(LIGATURES_LIBS)

# flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)

# OpenBSD:
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
#       `pkg-config --libs fontconfig` \
#       `pkg-config --libs freetype2`

# compiler and linker
# CC = c99

@bakkeby
Copy link
Owner

bakkeby commented Aug 5, 2021

Do you still have SIXEL_PATCH enabled in your patches.h file?

#define SIXEL_PATCH 1

@0xGodspeed
Copy link
Author

yes

@bakkeby
Copy link
Owner

bakkeby commented Aug 5, 2021

I went through the patches again from your first post. Looks like there is a conflict between the w3m patch and the sixel patch that causes this.

@0xGodspeed
Copy link
Author

You're right, sixel works after I disable w3m.
There is no need to make changes in the Makefile either.

@bakkeby
Copy link
Owner

bakkeby commented Aug 5, 2021

I dunno why it was removed removed from the Makefile

@schrmh I moved all of the ligatures and sixel stuff out of the Makefile into config.mk to make it easier and more consistent for people, i.e. you only need to uncomment things in config.mk now instead of having to fiddle in both that and the Makefile.

I'll update the misleading comment in patches.def.h.

@0xGodspeed
Copy link
Author

so, can the conflict between w3m and sixel be fixed?

@bakkeby
Copy link
Owner

bakkeby commented Aug 5, 2021

So to get w3m images to show you need to have both W3M_PATCH and SINGLE_DRAWABLE_BUFFER_PATCH enabled, in which case the SIXEL_PATCH will work as well.

But as far as I can tell you can't combine the above with the ALPHA_PATCH as w3m images do not show then.

@0xGodspeed
Copy link
Author

do w3m images not show even when transparency is 0 with ALPHA_PATCH enabled?

@0xGodspeed
Copy link
Author

nvm i checked and they don't

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

No branches or pull requests

3 participants