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

Add autoterminal #98

Merged
merged 43 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2a71479
Load and show foxel35 font
basxto Dec 28, 2019
167c8b7
Use string buffer in terminal
basxto Dec 29, 2019
7a65c1f
Run shell commands and print them:wq
basxto Dec 29, 2019
9e42830
Type shell commands
basxto Dec 30, 2019
c09c86c
Rename terminal to autoterminal
basxto Dec 30, 2019
cb88c88
Autoterminal: Add color
basxto Jan 1, 2020
e1ee2c6
Autoterminal: Add bright colors
basxto Jan 1, 2020
df0b2d4
Autoterminal: Read from script
basxto Jan 1, 2020
cdcd9e3
Autoterminal: Tell screen size
basxto Jan 2, 2020
03aeef9
Autoterminal: Support 8 bit color codes
basxto Jan 4, 2020
9b29042
Autoterminal: Clean up
basxto Jan 4, 2020
3d5cae9
Autoterminal: Improve parsing long lines
basxto Jan 4, 2020
27c7042
Autoterminal: Support cursor movement & fix breaks
basxto Jan 5, 2020
1743b1a
Autoterminal: Free memory
basxto Jan 9, 2020
f76112c
Autoterminal: Parse cout char wise
basxto Jan 10, 2020
acf742d
Autoterminal: Launch commands in own thread
basxto Jan 10, 2020
c6a7882
Autoterminal: Use PTY and tell ncurses what our terminal can do
basxto Jan 10, 2020
6dcd55e
Autoterminal: Switch from pthread to oscore
basxto Jan 11, 2020
709ef46
Autoterminal: Remove unused code
basxto Jan 11, 2020
3513778
Autoterminal: Get shell from shebang line
basxto Jan 11, 2020
a8abce2
Autoterminal: Fix some codacy nags
basxto Jan 11, 2020
cffcf72
Autoterminal: Cast getc's return value later
basxto Jan 11, 2020
df8babc
Autoterminal: Fix emtpy values in CSI escape codes
basxto Jan 11, 2020
dfc1140
Autoterminal: Fix CSI code H
basxto Jan 12, 2020
e358ed7
Autoterminal: Split terminal logic & font drawing
basxto Jan 12, 2020
2a278c5
Autoterminal: Add functions with default values
basxto Jan 12, 2020
d7aba39
Fix makefile
basxto Jan 12, 2020
266b4fa
Autoterminal: Support intense, faint and inverse
basxto Jan 12, 2020
4abe2c6
Rename xbm_font_loader to printbuffer
basxto Jan 12, 2020
c832f40
Printbuffer: Allow to include via header file
basxto Jan 13, 2020
8f69b51
Autoterminal: Add blinking and altchars
basxto Jan 13, 2020
cc1ed3a
Printbuffer: Handle unicode as one string
basxto Jan 13, 2020
5de8492
Printbuffer: Support more unicode and powerline
basxto Jan 13, 2020
1e94f59
Fix small displays
basxto Jan 13, 2020
bae20dc
Autoterminal: Fix foreground color reset
basxto Jan 13, 2020
630b289
Printbuffer: Add suits for tty-solitaire
basxto Jan 13, 2020
6eac4de
Printbuffer: Support weird space from powerline
basxto Jan 13, 2020
7c246d7
Printbuffer: Fix segfault when reaching last line
basxto Jan 14, 2020
f66b6d4
Autoterminal: Join threads
basxto Jan 14, 2020
e606172
Autoterminl: Add more control sequences and characters
basxto Jan 15, 2020
9d92ddf
Autoterminal: Kill child process on deinit and reset
basxto Jan 15, 2020
4373fe5
Autoterminal: Update terminfo, add new features
basxto Jan 15, 2020
122e5ce
Autoterminal: Execute in scripts folder
basxto Jan 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sledconf
/modules
sled
sled.fish
terminfo/

# crashy stuff
*.core
Expand All @@ -31,4 +32,4 @@ src/modules/out_ctru_shbin*

# CLion
.idea/
/compile_commands.json
/compile_commands.json
9 changes: 6 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ CPPFLAGS += -Wall

# NOTE: This is overridable because a nonposix user might also not be able to rely on -lm.
# In this case, it's their problem as to how to get the maths routines into the system...
LIBS ?= -lm
LIBS ?= -lm -lutil

ifeq ($(STATIC),0)
OS := $(shell uname)
Expand Down Expand Up @@ -168,11 +168,12 @@ include Makefiles/card10.GNUmakefile

# --- All/Cleaning begins here ---

all: $(PROJECT) $(MODULES_DYNAMIC_SO) $(COPY_SLEDCONF)
all: $(PROJECT) $(MODULES_DYNAMIC_SO) $(COPY_SLEDCONF) terminfo/a/autoterminal

clean: FORCE
rm -f $(PROJECT) $(OBJECTS) modules/*.so src/modules/*.o static/modwraps/*.c static/modwraps/*.o static/modwraps/*.incs src/slloadcore.gen.c
rm -f src/modules/mod_dl.c.libs
rm -r ./terminfo/

default_sledconf: FORCE
[ -e sledconf ] || cp Makefiles/sledconf.default sledconf
Expand All @@ -198,8 +199,10 @@ src/slloadcore.gen.c: src/plugin.h static/k2link
static/modwraps/%.c: src/modules/%.c
./static/k2wrap $*

# --- Platform-specific module library rules begin here ---
terminfo/a/autoterminal: autoterminal.terminfo
tic -o terminfo $<

# --- Platform-specific module library rules begin here ---
ifeq ($(OS),Linux)
src/modules/mod_dl.c.libs:
echo -ldl > src/modules/mod_dl.c.libs
Expand Down
12 changes: 12 additions & 0 deletions autoterminal.terminfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
autoterminal|autoterminal module for sled,
colors#0x100, pairs#0x10000, cols#8, lines#3, it#8, bce, msgr,
cr=\r, ind=\n,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
cuu=\E[%p1%dA, cuu1=\E[A,
cud=\E[%p1%dB, cud1=\n,
cuf=\E[%p1%dC, cuf1=\E[C,
cub=\E[%p1%dD, cub1=\E[D,
clear=\E[H\E[2J, cup=\E[%i%p1%d;%p2%dH, home=\E[H,
ed=\E[J, el=\E[K, el1=\E[1K,
hpa=\E[%i%p1%dG,
6 changes: 6 additions & 0 deletions scripts/autoterminal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
#timeout 30 asciiquarium
ls --color
fortune | cowsay
echo $TERM @$(hostname)
sleep 5
35 changes: 35 additions & 0 deletions src/modules/foxel35.xbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#define foxel35_width 64
#define foxel35_height 48
static unsigned char foxel35_bits[] = {
0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x77, 0x77, 0x77, 0x77,
0x77, 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x75, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x75,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x75, 0x77, 0x77, 0x77, 0x77,
0x77, 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x55, 0x56, 0x22, 0x14, 0x02, 0x00, 0x40, 0x20, 0x75, 0x43, 0x21,
0x22, 0x27, 0x00, 0x40, 0x20, 0x50, 0x26, 0x02, 0x22, 0x72, 0x70, 0x20,
0x00, 0x70, 0x13, 0x05, 0x22, 0x25, 0x02, 0x10, 0x20, 0x50, 0x52, 0x06,
0x14, 0x00, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22, 0x76, 0x71, 0x77, 0x77, 0x00, 0x04, 0x71, 0x35, 0x45, 0x11, 0x41,
0x55, 0x22, 0x72, 0x42, 0x27, 0x64, 0x77, 0x27, 0x77, 0x00, 0x01, 0x24,
0x25, 0x42, 0x42, 0x25, 0x45, 0x22, 0x72, 0x02, 0x22, 0x77, 0x32, 0x27,
0x77, 0x10, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22, 0x63, 0x73, 0x67, 0x75, 0x57, 0x51, 0x63, 0x55, 0x15, 0x15, 0x11,
0x25, 0x54, 0x71, 0x55, 0x77, 0x13, 0x35, 0x53, 0x27, 0x34, 0x71, 0x55,
0x51, 0x15, 0x15, 0x51, 0x25, 0x54, 0x51, 0x55, 0x56, 0x67, 0x73, 0x61,
0x75, 0x53, 0x57, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x27, 0x67, 0x57, 0x55, 0x55, 0x37, 0x61, 0x02, 0x55, 0x15, 0x52, 0x55,
0x55, 0x14, 0x41, 0x05, 0x57, 0x73, 0x52, 0x75, 0x22, 0x12, 0x42, 0x00,
0x71, 0x45, 0x52, 0x72, 0x25, 0x11, 0x44, 0x00, 0x61, 0x35, 0x62, 0x52,
0x25, 0x37, 0x64, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x01, 0x04, 0x06, 0x21, 0x12, 0x01, 0x00, 0x64, 0x67, 0x77, 0x62,
0x07, 0x50, 0x71, 0x73, 0x50, 0x15, 0x35, 0x57, 0x25, 0x32, 0x71, 0x55,
0x70, 0x67, 0x67, 0x72, 0x25, 0x52, 0x53, 0x75, 0x00, 0x00, 0x00, 0x60,
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x60, 0x32, 0x70, 0x77, 0x63, 0x53, 0x55,
0x55, 0x27, 0x22, 0x76, 0x55, 0x21, 0x51, 0x75, 0x22, 0x12, 0x42, 0x73,
0x77, 0x31, 0x63, 0x72, 0x25, 0x27, 0x22, 0x70, 0x41, 0x00, 0x00, 0x00,
0x10, 0x60, 0x32, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Loading