Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / destroyer.cpp.patch
Created June 12, 2018 14:58
Sixelize "destroyer" demo at Marzac/le3d(https://github.com/Marzac/le3d)
diff --git a/examples/destroyer/CMakeLists.txt b/examples/destroyer/CMakeLists.txt
index 7ac2cba..2c0912a 100644
--- a/examples/destroyer/CMakeLists.txt
+++ b/examples/destroyer/CMakeLists.txt
@@ -22,6 +22,7 @@ target_link_libraries(
destroyer
PRIVATE
le3d
+ sixel
)
@saitoha
saitoha / cube.cpp.patch
Last active June 12, 2018 14:42
Sixelize "cube" demo at Marzac/le3d(https://github.com/Marzac/le3d)
diff --git a/examples/cube/CMakeLists.txt b/examples/cube/CMakeLists.txt
index 5521cac..cdc366c 100644
--- a/examples/cube/CMakeLists.txt
+++ b/examples/cube/CMakeLists.txt
@@ -22,6 +22,7 @@ target_link_libraries(
cube
PRIVATE
le3d
+ sixel
)
@saitoha
saitoha / main.cpp.patch
Created June 12, 2018 14:01
sixelized output for ssloy/tinyrenderer (https://github.com/ssloy/tinyrenderer)
diff --git a/Makefile b/Makefile
index 0b0a469..5cbdce8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
SYSCONF_LINK = g++
CPPFLAGS = -Wall -Wextra -Weffc++ -pedantic -std=c++98
LDFLAGS = -O3
-LIBS = -lm
+LIBS = -lm -lsixel
diff --git a/build.sh b/build.sh
index bd9788c..f8781e3 100755
--- a/build.sh
+++ b/build.sh
@@ -42,4 +42,5 @@ then
done
fi
-gcc -Werror -O3 main.c -lncurses -lm -o build/term-mode7
+gcc -Werror -DHAVE_SIXEL -O3 main.c -lncurses -lm -lsixel -o build/term-mode7
@saitoha
saitoha / gist:9beac1158f7bd3d89d1a552c3480fd80
Created June 22, 2017 14:37
https://github.com/ThomasDickey/xterm-snapshots $ git diff 657acb2a64de3bdc3c71a6d6808c3e5d1ecfe90b 01ca97551878eeea5f739c7011302b19b1a3530c wcwidth.c
diff --git a/wcwidth.c b/wcwidth.c
index d3ca844..fef1e33 100644
--- a/wcwidth.c
+++ b/wcwidth.c
@@ -1,8 +1,59 @@
-/* $XTermId: wcwidth.c,v 1.25 2016/05/22 17:15:29 tom Exp $ */
+/* $XTermId: wcwidth.c,v 1.39 2017/06/20 20:35:34 tom Exp $ */
/* $XFree86: xc/programs/xterm/wcwidth.c,v 1.9 2006/06/19 00:36:52 dickey Exp $ */
@saitoha
saitoha / xterm-fix-hls2rgb.patch
Created June 21, 2017 17:49
xterm: fix wrong HLS-to-RGB conversion
diff --git a/graphics.c b/graphics.c
index 4bd50b4..b6f9e54 100644
--- a/graphics.c
+++ b/graphics.c
@@ -1089,7 +1089,7 @@ outline_refresh(TScreen const *screen,
void
hls2rgb(int h, int l, int s, short *r, short *g, short *b)
{
- const int hs = ((h + 240) / 60) % 6;
+ const int hs = ((h = (h + 240) % 360) / 60) % 6;
@saitoha
saitoha / rxvt-unicode-sixel.patch
Last active May 2, 2019 10:17
Add SIXEL graphics support for rxvt-unicode.
diff --git a/src/Makefile.in b/src/Makefile.in
index 18acb39e..ef2e7a40 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -40,7 +40,7 @@ COMMON = \
screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \
scrollbar-xterm.o scrollbar-plain.o xdefaults.o encoding.o \
rxvttoolkit.o rxvtutil.o keyboard.o rxvtimg.o \
- ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o @PERL_O@
+ ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o sixel.o @PERL_O@
@saitoha
saitoha / suckless-st-sixel.diff
Last active December 9, 2024 17:24
Add SIXEL graphics support for suckless st. (sixel.c/sixel_hls.c come from mintty, licensed under GPL)
commit ea830e03d4d4562b1ff225940f65bceddd9cad6c
Author: Hayaki Saito <saitoha@me.com>
Date: Sun Jun 11 23:46:45 2017 +0900
Add sixel graphics support
Signed-off-by: Hayaki Saito <saitoha@me.com>
diff --git a/Makefile b/Makefile
index d8595fe..a25d040 100644
@saitoha
saitoha / jobs.c.patch
Last active August 29, 2016 17:03
workaround for bash 4.3 segfault problem on i686-pc-cygwin
diff --git a/jobs.c b/jobs.c
index b6e59eb..9ccf232 100644
--- a/jobs.c
+++ b/jobs.c
@@ -2548,6 +2548,9 @@ itrace("wait_for: blocking wait for %d returns %d child = %p", (int)pid, r, chil
/* Restore the original SIGINT signal handler before we return. */
restore_sigint_handler ();
+ if (!child)
+ goto wait_for_return;
@saitoha
saitoha / xsixel-cygwin.patch
Created August 20, 2016 06:35
Xsixel on cygwin-i686
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 3eb15b9..155519c 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -316,7 +316,7 @@ WaitForSomething(int *pClientsReady)
nready = 0;
if (XFD_ANYSET(&clientsReadable)) {
#ifndef WIN32
- for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) {
+ for (i = 0; i < howmany(FD_SETSIZE, NFDBITS); i++) {