Compare commits

...

369 Commits

Author SHA1 Message Date
Hiltjo Posthuma 4ef0cbd8b9 remove unused variable from previous patch
4 years ago
John Collis 28b4c822c5 ST: Add WM_ICON_NAME property support
4 years ago
Hiltjo Posthuma fa253f077f bump version to 0.8.4
4 years ago
Hiltjo Posthuma b27a383a3a config.mk: use PKG_CONFIG in commented OpenBSD section
4 years ago
Hiltjo Posthuma 81067c65ea LICENSE: bump years
4 years ago
Hiltjo Posthuma f74a9df6e1 remove sixel stub code
4 years ago
Hiltjo Posthuma 818ec746f4 fix unicode glitch in DCS strings, patch by Tim Allen
4 years ago
Hiltjo Posthuma 9ba7ecf7b1 FAQ: fix single-buffer patch
4 years ago
Hiltjo Posthuma a2a704492b config.def.h: add an option allowwindowops, by default off (secure)
4 years ago
Hiltjo Posthuma 0f8b40652b FAQ: add some details about the w3m img hack
4 years ago
Hiltjo Posthuma e6e2c6199f tiny style fix
4 years ago
Hiltjo Posthuma 94b8ec0021 Partially add back in "support REP (repeat) escape sequence"
4 years ago
Steve Ward dec6b530a4 Call xsetcursor to set win.cursor in main
4 years ago
Hiltjo Posthuma 475a0a36cb Revert "support REP (repeat) escape sequence"
4 years ago
Avi Halachmi (:avih) e8392b282c support REP (repeat) escape sequence
4 years ago
Roberto E. Vargas f8afebdfa0 Add rin terminfo capability
4 years ago
k0ga bda9c9ffa6 Make shift+wheel behaves as shift+Prev/Next
4 years ago
Jakub Leszczak 045a0fab4f Fix selection: selscroll
4 years ago
Jakub Leszczak 9c30066e73 Fix selection: ignore ATTR_WRAP when rectangular selection in getsel
4 years ago
Jakub Leszczak 8304d4f059 Fix selection: selclear in tputc
4 years ago
Hiltjo Posthuma 914fb825df code-style: add fallthrough comment
4 years ago
Hiltjo Posthuma cde480c693 optimize column width calculation and utf-8 encode for ASCII
4 years ago
Hiltjo Posthuma 8211e36d28 fix for incorrect (partial) written sequences when libc wcwidth() == -1
4 years ago
Hiltjo Posthuma 87545c612e tiny code-style and typo-fix in comment
4 years ago
Avi Halachmi (:avih) 1d59091065 auto-sync: draw on idle to avoid flicker/tearing
4 years ago
Jan Klemkow d6ea0a1a61 replace exit(3) by _exit(2) in signal handler sigchld()
4 years ago
Hiltjo Posthuma 43a395ae91 bump version to 0.8.3
4 years ago
Ivan Tham 72e3f6c7c0 Update XIM cursor position only if changed
4 years ago
Hiltjo Posthuma 33a9a45664 just remove the EOF message
4 years ago
Roberto E. Vargas Caballero 771bc401f7 Add st-mono terminfo entry
4 years ago
Hiltjo Posthuma d66bd405c0 config.def.h: add a comment for the scroll variable
4 years ago
Hiltjo Posthuma e997303502 Fix small typos
4 years ago
Quentin Rameau c1145268f6 Launch scroll program with the default shell
4 years ago
Roberto E. Vargas Caballero 0b73612c0d Update FAQ with the last modifications
4 years ago
Roberto E. Vargas Caballero 019449a7e6 Add terminfo entries for backspace mode
4 years ago
Roberto E. Vargas Caballero fbae700a3f Fix style issue
4 years ago
Roberto E. Vargas Caballero e52319cc7d ttyread: test for EOF while reading tty
4 years ago
Roberto E. Vargas Caballero 21e0d6e8b8 Add support for scroll(1)
4 years ago
Hiltjo Posthuma 5703aa0390 make argv0 not static, fixes a warning with tcc
4 years ago
Avi Halachmi (:avih) 28ad288399 mouseshortcuts: fix custom modifier on release
4 years ago
Ivan Tham 51e19ea11d Remove explicit XNFocusWindow
4 years ago
Quentin Rameau 26cdfebf31 x: fix XIM handling
4 years ago
Quentin Rameau cd785755f2 x: check we still have an XIC context before accessing it
4 years ago
Quentin Rameau 2cb539142b x: do not instantiate a new nested list on each cursor move
4 years ago
Quentin Rameau 99de333951 x: move IME variables into XWindow ime embedded struct
4 years ago
Ivan Tham 895e5b50a8 Increase XmbLookupString buffer
4 years ago
Hiltjo Posthuma 384830110b update FAQ
5 years ago
Avi Halachmi (:avih) 2e54a21b5a OSC 52 - copy to clipboard: don't limit to 382 bytes
5 years ago
Hiltjo Posthuma 289c52b7aa CSIEscape, STREscape: use size_t for buffer length
5 years ago
Avi Halachmi (:avih) 7ceb3d1f72 STREscape: don't trim prematurely
5 years ago
Avi Halachmi (:avih) ea4d933ed9 base64dec: don't read out of bounds
5 years ago
Sebastian J. Bronner 83866428de Fix tmux terminfo extensions Se and Ss
5 years ago
Ingo Lohmar 1f09f0b0bb apply hints before initial mapping (ICCCM)
5 years ago
Avi Halachmi (:avih) a2c479c4c8 mouse shortcuts: allow using forcemousemod (e.g. shift)
5 years ago
Avi Halachmi (:avih) d2b75db8d7 mouse shortcuts: don't hardcode selpaste
5 years ago
Avi Halachmi (:avih) b6d280de6d mouse shortcuts: allow override for all shortcuts
5 years ago
Avi Halachmi (:avih) ba7f4d69af mouse shortcuts: allow same functions as kb shortcuts
5 years ago
Hiltjo Posthuma 2b8333f553 config.def.h: remove crlf value section
5 years ago
Hiltjo Posthuma caa1d8fbea FAQ: add entry about color emoji Xft bug
5 years ago
Avi Halachmi (:avih) f1546cf9c1 selection: fix view to match actual selection on first cell
5 years ago
Hiltjo Posthuma 21367a040f revert part of commit add0211522
5 years ago
Hiltjo Posthuma b650256044 dont print color warning on color reset OSC 104 without parameter
5 years ago
Hiltjo Posthuma 9acec468fb minor code-style, initialize var at the top of function
5 years ago
Hiltjo Posthuma 927621f6da config.def.h: tweak extra worddelimiters
5 years ago
Lauri Tirkkonen add0211522 use iswspace()/iswpunct() to find word delimiters
5 years ago
Lauri Tirkkonen d5efd256aa replace utf8strchr with wcschr
5 years ago
Lauri Tirkkonen 75b4ba4b4b be silent about explicitly unhandled mouse modes
5 years ago
Hiltjo Posthuma ed68fe7dce simplify (greedy) font caching allocating a bit
5 years ago
Hiltjo Posthuma 4e0135afec style: remove double empty newlines
5 years ago
magras a8cb8e9454 fix use after free in font caching algorithm
5 years ago
Ivan Tham e85b6b6466 better Input Method Editor (IME) support
5 years ago
Hiltjo Posthuma 75f92eb348 bump version to 0.8.2
5 years ago
Hiltjo Posthuma 3be4cf11d7 config: add Shift+Insert as selpaste() again
5 years ago
Paride Legovini 16d98738e7 Let the user specify CPPFLAGS
5 years ago
Paride Legovini e23acb9188 Set the path of pkg-config in a variable instead of hardcoding it
5 years ago
Hiltjo Posthuma 7e19e11676 Makefile: fix dependencies on config.h
5 years ago
Lauri Tirkkonen 096b125db7 output child WEXITSTATUS/WTERMSIG on abnormal termination
6 years ago
Hiltjo Posthuma d7bf023b2f fix memory leak in xloadcols()
6 years ago
Hiltjo Posthuma b4d68d4daa st: small typofix in comment
6 years ago
Hiltjo Posthuma 30ec9a3dc3 small code-style fix
6 years ago
Quentin Rameau 67d0cb65d0 Remove the ISO 14755 feature
6 years ago
Hiltjo Posthuma 4f4bccd162 Revert "Simplify cursor color handling"
6 years ago
Hiltjo Posthuma 8ed7a4b3b7 Revert "Make cursor follow text color"
6 years ago
Hiltjo Posthuma 732be223ee Revert "Fix crash when cursor color is truecolor"
6 years ago
Jules Maselbas 5535c1f04c Fix crash when cursor color is truecolor
6 years ago
Jules Maselbas b51bcd5553 Make cursor follow text color
6 years ago
Jules Maselbas 1911c9274d Simplify cursor color handling
6 years ago
Jules Maselbas 29f341da7c Fix crash on resize
6 years ago
Hiltjo Posthuma dc3b5babf1 config.mk: remove extra newline before EOF
6 years ago
Hiltjo Posthuma 235a783e03 code-style for pledge(2)
6 years ago
Hiltjo Posthuma 30ce2cc002 Pledge on OpenBSD
6 years ago
Hiltjo Posthuma 041912a791 error message style and use strerror in a few places
6 years ago
Hiltjo Posthuma bd3f7fd842 st -v: remove years and copyright text
6 years ago
Daniel Tameling 74cff67bd7 set sel.alt in selstart instead of selextend
6 years ago
Hiltjo Posthuma 6f0f2b7ec3 bump version to 0.8.1
6 years ago
Hiltjo Posthuma f4020b2cc4 fix regression by selecting clipboard text
6 years ago
Hiltjo Posthuma a5a928bfc1 don't modify argv, use a counter
6 years ago
Hiltjo Posthuma 6ac8c8aa50 selextend: clarify: !sel.mode == SEL_IDLE
6 years ago
Hiltjo Posthuma 5345db3c9b clipcopy: no need to check for free(NULL), set to NULL after free
6 years ago
Hiltjo Posthuma 7648697f71 minor code-style: whitespace fixes
6 years ago
Quentin Rameau 0b507bb731 Fix title initialization
6 years ago
Quentin Rameau e7ef3c4ce9 Fix regression from 69e32a6 when setting title.
6 years ago
Hiltjo Posthuma 8ab629031b LICENSE: fix a few years
6 years ago
Hiltjo Posthuma a712c2dd18 update LICENSE: major contributors
6 years ago
Hiltjo Posthuma 0f245dfeb9 Makefile: add all files to make dist
6 years ago
Hiltjo Posthuma 49a4f91fc5 bump version to 0.8
6 years ago
Hiltjo Posthuma c5ba9c025b use math.h for ceilf
6 years ago
Hiltjo Posthuma b81888ee7d xhints: no need to initialize sizeh
6 years ago
Hiltjo Posthuma 8b8255ac0e regression: include termios.h for tcsendbreak etc
6 years ago
Devin J. Pohly 20e0da7f14 General cleanup
6 years ago
Devin J. Pohly 403c57ebb5 Clean up #includes
6 years ago
Devin J. Pohly e0215d5377 Reduce visibility wherever possible
6 years ago
Devin J. Pohly 30683c70ab Limit usage of extern to config.h globals
6 years ago
Devin J. Pohly a3beb626d2 Remove x.c dependency on term
6 years ago
Devin J. Pohly a5dc1b4697 Pull term references out of xdrawcursor
6 years ago
Devin J. Pohly 88d8293fb4 Move win-agnostic parts of draw/drawregion to st.c
6 years ago
Devin J. Pohly 05c66cb37d Split mode bits between Term and TermWindow
6 years ago
Devin J. Pohly 33201ac65f Move CRLF input processing into ttywrite
6 years ago
Devin J. Pohly 52d6fb1ab1 Move terminal echo logic into st.c
6 years ago
Devin J. Pohly cfc7acdfd9 Move remaining selection mode logic into selextend
6 years ago
Devin J. Pohly bcb5d3adbe Move terminal-related selection logic into st.c
6 years ago
Devin J. Pohly 5683b1f80c Move X-specific selection info into XSelection
6 years ago
Devin J. Pohly 138caf294e Have selected() check whether selection exists
6 years ago
Devin J. Pohly d84f3f4bd1 Rely on ttyresize to set tty size
6 years ago
Devin J. Pohly 8b564c1a3f Remove X and fontconfig from st.c
6 years ago
Devin J. Pohly 3bb900cd6c Remove Time argument from xsetsel
6 years ago
Devin J. Pohly 323d38da20 Make win variable internal to x.c
6 years ago
Devin J. Pohly 416dd25727 Move X-related config.h types into x.c
6 years ago
Devin J. Pohly 75c9a0ee1d Remove unneeded array-length variables
6 years ago
Devin J. Pohly 428f01969a Inline clipboard functions
6 years ago
Devin J. Pohly 65976c1a29 Move config.h include from st.c to x.c
6 years ago
Devin J. Pohly 32d3b1d00f Factor out equivalent code from ttyread/ttysend
6 years ago
Devin J. Pohly 69e32a61df Move opt_* into same file as main()/run()
6 years ago
Devin J. Pohly ed132e1127 Move key-matching functions into x.c
6 years ago
Devin J. Pohly dbe8676d7d Pass new dimensions into ttyresize
6 years ago
Devin J. Pohly a8314643b1 Move window-manipulating functions into x.c
6 years ago
Devin J. Pohly a09138afa5 Move font/fontspec variables into x.c and XWindow
6 years ago
Devin J. Pohly 626b0ae40c Move window urgency handling entirely into x.c
6 years ago
Devin J. Pohly d5275012b4 Move zoom functions into x.c
6 years ago
Devin J. Pohly 3518dba2a5 Move usage() to be with run() in x.c
6 years ago
Devin J. Pohly 3e44ee5569 Call xsetenv() in main process instead of child
6 years ago
Benno Fünfstück 1f24bde82b Fix color with FAINT attribute
7 years ago
Benno Fünfstück e829e13bb1 Apply ATTR_REVERSE after ATTR_FAINT
7 years ago
George Ornbo c1d23afa9c Fix FAQ typo
7 years ago
Paride Legovini 0ac685fc01 Fix manpage typo
7 years ago
Gary Allen Vollink b1338e91ed Add an error for XftFontOpenPattern failure.
7 years ago
Hiltjo Posthuma b2ac917753 Revert "Revert "fixed STLDFLAG order in broken st Makefile""
7 years ago
Suraj N. Kurapati ee5cc8e903 base64dec: skip non-printable characters like \r\n
7 years ago
Hiltjo Posthuma 274d46ace0 Revert "fixed STLDFLAG order in broken st Makefile"
7 years ago
Hiltjo Posthuma 9c61f29bb7 Revert "make clipboard patch obsolete"
7 years ago
Anselm R Garbe 77c51c5a6b make clipboard patch obsolete
7 years ago
Anselm R Garbe 7f990328e4 fixed STLDFLAG order in broken st Makefile
7 years ago
Quentin Rameau 8dacdfbab1 Revert "Add bold off SGR"
7 years ago
Quentin Rameau c0882f2ed1 Add dim/smxx/rmxx to terminfo, remove duplicate kich1
7 years ago
Quentin Rameau d4928edba0 Let the user specify C and LD FLAGS
7 years ago
Quentin Rameau fabd4602b3 Do not obfuscate what make is doing.
7 years ago
Marc André Tanner b331da550b Add color change terminfo capabilities
7 years ago
Quentin Rameau 6cb6d61525 Add bold off SGR
7 years ago
greg.reagle@umbc.edu 5a10aca702 st.1: modify man page to accurately reflect default keybindings
7 years ago
Quentin Rameau 745c40f8b0 Simplify how we keep ATTRs under cursor
7 years ago
Alexander Krotov 149c0d3aed Fix commented out code
7 years ago
Nils Reuße f2bfd513b1 keep some glyph modes for the cursor
7 years ago
osandov@osandov.com e7ed326d2e Support xterm Ms feature to set clipboard
7 years ago
Roberto E. Vargas Caballero 20f713548d Change default keybindings
7 years ago
Michael Forney e2ee5ee611 Split X-specific code into x.c
7 years ago
fpqc c63a87cd93 Move column and row default numbers into config.h
8 years ago
Roberto E. Vargas Caballero e44832408b Revert "Initial font size issue."
8 years ago
Spencer Phippen fa9a459972 Fixed 'missing glyph doesn't use fontconfig config substitutions' bug
8 years ago
Manuel Tobias Schiller 740ada1447 make the various combinations of arrow keys and shift/control/meta work
8 years ago
ian@remmler.org 424202798b Initial font size issue.
8 years ago
pl@ninthfloor.org 3ca7249c86 tic -s -> tic -sx (Treat unknown capabilities as user-defined.)
8 years ago
pl@ninthfloor.org 06f8cf8ca8 Add tmux capabilities to st.info
8 years ago
pl@ninthfloor.org 902a392b90 Make strdump(), csidump(), print to stderr
8 years ago
Quentin Rameau 8c99915608 Do not use color when font attributes are supported
8 years ago
Quentin Rameau 7854fde1ff st.1: add an entry for ISO-14755 shortcut
8 years ago
Quentin Rameau 68bae9c7b1 Add support for iso14755
8 years ago
Klemens Nanni 331033f1f6 Add missing device path to '-l' example
8 years ago
Roberto E. Vargas Caballero f7398434b8 Add parsing of DCS q sequences
8 years ago
Roberto E. Vargas Caballero f0e2d28732 Add support for enabling/disabling utf
8 years ago
Roberto E. Vargas Caballero 078337d745 Delete ncv capability from terminfo
8 years ago
Quentin Rameau 5ce853a1c1 st.info: do not prevent st from displaying attributes
8 years ago
Christoph Lohmann 023225ef40 Update the LICENSE.
8 years ago
Christoph Lohmann 6e79e8357e 0.7 release
8 years ago
Christoph Lohmann 308bfbf6be Change who's expanding tabs.
8 years ago
Christoph Lohmann c4f245eccd Add some hint to have the pseudo terminal in the right mode.
8 years ago
Christoph Lohmann 2251f6465a Add comment about tabspaces.
8 years ago
Alive 4ever 235b438e68 Consistent Alt+BackSpace behavior
8 years ago
Christoph Lohmann 528241aa38 Use XftFontMatch in place of FcFontMatch.
8 years ago
v4hn 60aeb37edb delete clipboard properties after pasting them
8 years ago
Roberto E. Vargas Caballero 66556d9670 Remove stupid assignation in memcpy()
8 years ago
Tor Andersson 39964614b7 st: Fix off-by-one error when calculating character width.
8 years ago
Ton van den Heuvel 0e48a1995e Fix vertical character alignment in some cases
8 years ago
Christoph Lohmann 6d8f85232e I like empty lines.
8 years ago
Ryusei Yamaguchi 034a5c8a09 Measure the single advance width with a heuristic method
8 years ago
Christoph Lohmann 30440295bc xtermclear() is now done by xdrawglyphfontspecs()
8 years ago
Lucas Gabriel Vuotto 4fdba860c8 arg.h: fixed argv checks order
8 years ago
Quentin Rameau 6d636beb22 Fix forgotten bracket and duplicate option in usage()
8 years ago
Quentin Rameau 6e70bb97d4 Extract ttyresize() out of cresize()
8 years ago
Christoph Lohmann 82335583eb Ok, no need for a separate version function.
8 years ago
Quentin Rameau 0cd5117a2c Add -n option for setting WM_CLASS instance name
8 years ago
Quentin Rameau bd5fdbe64c Reformat usage and separate version from it
8 years ago
Christoph Lohmann 504a165277 Enforce a terminal size to reduce race conditions in too efficient apps.
8 years ago
Christoph Lohmann 9031e228ce Height is height.
8 years ago
Christoph Lohmann 610723a58f Bump year.
9 years ago
Christoph Lohmann ff241199ed Fixing the XClassHint setting in st.
9 years ago
Roberto E. Vargas Caballero 375b28720f Avoid recursive call to ttywrite from ttyread
9 years ago
Quentin Rameau d836561b96 arg.h: remove unused macros
9 years ago
Christoph Lohmann 00873e65ee Introduce lim in all ttywrite() checks.
9 years ago
Roberto E. Vargas Caballero 9f6d8845df Fix ttywrite()
9 years ago
Ivan Tham f0398db4d1 Now the mshortcuts are even more consistent.
9 years ago
Christoph Lohmann e2aa03e6b7 Now the Shortcuts are more consistent.
9 years ago
Jason Woofenden f56c58a968 fix bug where first selection snaps to lines
9 years ago
Quentin Rameau 293f573efd Fix the cursor colors selection
9 years ago
Christoph Lohmann 2ea02c937e Normalize the whole color selection in xdrawcursor.
9 years ago
Quentin Rameau 80fe97f8a6 Fix the cursor color when over selection.
9 years ago
Christoph Lohmann a2a60f0a2c Make the cursor shapes more descriptive.
9 years ago
Christoph Lohmann 52d0e82df7 Snowman is everywhere.
9 years ago
Christoph Lohmann 78b04865fb Style normalisation in the config.def.h.
9 years ago
Christoph Lohmann f7b80caebe The definition of the reverse cursor is now up to the user.
9 years ago
Christoph Lohmann 594a259836 Fixing the cursor movement in selections.
9 years ago
Christoph Lohmann 91c70213d1 When the cursor is moved, clear the selection.
9 years ago
Christoph Lohmann 2677296147 Reverse the cursor on selection.
9 years ago
Christoph Lohmann 5ece2b5f4a More style changes. We forgot some switches.
9 years ago
Christoph Lohmann 2bef36ab81 Small style change.
9 years ago
Christoph Lohmann 1682484327 There's no need for libXext to compile st.
9 years ago
dequis 4be353e381 Fix extra bracketed paste markers when pasting >8kb
9 years ago
FRIGN 20d53cebc1 dup() -> dup2()
9 years ago
Christoph Lohmann bf8c71e429 The times of bad fonts are over.
9 years ago
Roberto E. Vargas Caballero 5d2d9d540d Fix copy of line with len = 0
9 years ago
Roberto E. Vargas Caballero a1ed5071e5 Change Pause to Break in shortcut for serial break
9 years ago
Jan Christoph Ebersbach 3ba9c8fc3f Expose cursor shape in config.def.h
9 years ago
Roberto E. Vargas Caballero 1f087aa8b7 Add key to send a break to the serial line
9 years ago
Roberto E. Vargas Caballero 473326f2e3 Set default values of stty according to the man page
9 years ago
Christoph Lohmann aa5d4c3b34 Making st.1 more descriptive about -l and fix -l in st.c.
9 years ago
Christoph Lohmann 080a5ae425 Fix the st manpage for -l line.
9 years ago
Christoph Lohmann 9eeb4e1ea2 Reordering and adding control codes.
9 years ago
Christoph Lohmann 0c94f8621b Merge branch 'master' of ssh://suckless.org/gitrepos/st
9 years ago
Christoph Lohmann 0d838b7243 Don't read if we chunked the input data.
9 years ago
Roberto E. Vargas Caballero 7e61f5e4c5 Do not mark as invalid UTF8 control codes
9 years ago
Quentin Rameau 9984ad4ba7 st.info: replace the acsc entry from xterm to urxvt
9 years ago
Alex Kozadaev ee5cad439b Adding mouse colour/shape settings
9 years ago
Christoph Lohmann dc33d1d66e Adding -T to the usage too.
9 years ago
Christoph Lohmann b5e29cce52 Add -T, as recommended by Dmitrij D. Czarkoff
9 years ago
Quentin Rameau 4a193b9686 Fix type for write(2) return variable.
9 years ago
Mytchel Hammond 1d348e98e3 added note about the low precedence of shell to config.def.h
9 years ago
Roberto E. Vargas Caballero 62756fdb49 Fix style in execsh
9 years ago
Christoph Lohmann d032b61597 Make the comment for the IM XFilter more understandable.
9 years ago
Christoph Lohmann 684c72d05e Return style unification.
9 years ago
Christoph Lohmann b823f57fa0 Aligning the macros.
9 years ago
Christoph Lohmann 684f0a0729 Unix end of file.
9 years ago
Christoph Lohmann d3c7b6fb73 No inline declarations please.
9 years ago
Christoph Lohmann 41f70a1cff Typo and the missing incr atom from the patches.
9 years ago
Christoph Lohmann 261ea4b7e0 Implement chunked write to the cmdfd.
9 years ago
Christoph Lohmann f8c6e7d041 Implement INCR transfers in the clipboard.
9 years ago
FRIGN 539afe3af1 Update LICENSE
9 years ago
FRIGN f1307d91e2 Don't treat clauses like functions
9 years ago
FRIGN 13233574ed Use BSD-style function notation
9 years ago
FRIGN 9de853a98d Unboolify st
9 years ago
FRIGN abfad4c4fc Remove insane *_FILENO and EXIT_* usage
9 years ago
Christoph Lohmann 92e092efe6 Commit to push the 0.6 release.
9 years ago
Weng Xuetian 5f48e89716 Revert "Remove unnecessary XFilterEvent call."
9 years ago
Quentin Rameau bdd649a102 do not truncate font size when zooming
9 years ago
Roberto E. Vargas Caballero 71fa10f613 Revert "Optimize memory footprint of line buffers"
9 years ago
Jan Christoph Ebersbach caa97cc781 Support UTF-8 characters as word delimiters
9 years ago
Roberto E. Vargas Caballero c03548750b Merge branch 'master' of ssh://suckless.org/gitrepos/st
9 years ago
v4hn 8e15887de9 set selection to IDLE on clear
9 years ago
suigin 89cf0fc597 Small bugfix for makeglyphfontspecs call in drawregion
9 years ago
Christoph Lohmann 980991fa6e Fix the new -e handling. An empty cmd has to work for backwards compatibility.
9 years ago
suigin ae1923d275 Clean up xdraws and optimize glyph drawing with non-unit kerning values
9 years ago
suigin 38af006b5e Changed type for UTF-32 codepoints from long to uint_least32_t
9 years ago
noname c990abfedf Fix empty selection highlighting bug.
9 years ago
noname 3cb7f27afe Fix indentation.
9 years ago
noname 1811b6030c Add enumeration for sel.mode
9 years ago
noname 22571ea4e8 selnormalize: make special case explicit
9 years ago
noname 8751809aff selsnap: simplify SNAP_LINE case
9 years ago
noname 765bb0fd14 Remove first argument of selsnap.
9 years ago
Jochen Sprickerhof 07ce96a3a0 Fix sigchld
9 years ago
mvdan@mvdan.cc 190b94c7a2 len assignment is never used
9 years ago
mvdan@mvdan.cc 4f21c41a1c Clarify calculation precedence for '&' and '?'
9 years ago
mvdan@mvdan.cc 3a5053f6c1 Use %u for uint
9 years ago
suigin 7ab6c92e18 Optimize memory footprint of line buffers
9 years ago
noname@inventati.org 0622ad9bad Make tputc, tsetchar and techo accept unicode
9 years ago
noname@inventati.org 21f765426c Change internal character representation.
9 years ago
noname@inventati.org 753fe862b1 Remove last parameter of utf8encode
9 years ago
noname@inventati.org 61c35cd246 Use utf8len instead of utf8decode.
9 years ago
alp@alexpilon.ca 742a41d655 Make build shut up about system() without return value check.
9 years ago
Roberto E. Vargas Caballero f36dd277a2 Merge remote-tracking branch 'origin/master'
9 years ago
Roberto E. Vargas Caballero 0d7448dabc Fix segmentation fault in strhandle()
9 years ago
Roberto E. Vargas Caballero b17aa18f7c Uses a &[] pointer loop instead of + pointer loop
9 years ago
noname@inventati.org 736685d641 Do not set terminal title based on stty arguments.
9 years ago
noname@inventati.org 89807ed453 Move common code to xloadcolor
9 years ago
noname@inventati.org 84c756b97e Use LEN(dc.col) instead of LEN(colorname).
9 years ago
noname@inventati.org 2fdcc5e5f6 Remove WIN_REDRAW flag.
9 years ago
noname@inventati.org ab69ea89b7 Place memset arguments in the correct order.
9 years ago
noname@inventati.org 5528280fae Remove explicit 'return' from 'void' functions.
9 years ago
noname@inventati.org 6dc2b546ec Increment accuaracy in drawtime calculation
9 years ago
noname@inventati.org c27c731b9f Monotonic clock cannot jump backwards.
9 years ago
noname@inventati.org 6ee56d6590 Place tlinelen type on separate line.
9 years ago
Roberto E. Vargas Caballero 215bdb2da3 Add tty line support
9 years ago
sin 56abffb4b6 Fix memmove() invocation with src/dst being NULL
9 years ago
noname@inventati.org aff35af275 Use as command arguments the remaining parameters
9 years ago
Roberto E. Vargas Caballero 83e73c6242 Merge branch 'master' of ssh://suckless.org/gitrepos/st
9 years ago
Markus Wichmann 42fa1f5ce4 Implement most ICCCM rules for selection handling.
9 years ago
Roberto E. Vargas Caballero 23ed12857f Merge branch 'master' of ssh://suckless.org/gitrepos/st
9 years ago
noname@inventati.org 9eb70a2d3e Do not use tmoveto in tputtab.
9 years ago
noname@inventati.org 9619760e12 tresize: remove unnecessary if
9 years ago
noname@inventati.org a6af2cc469 Remove old TODO entry.
9 years ago
noname@inventati.org b94ad75e5d Remove 'titles' variable.
9 years ago
noname@inventati.org e6dd0f825d Remove useless if in tstrsequence.
9 years ago
noname@inventati.org b0310fba5d Simplify tmoveto.
9 years ago
noname@inventati.org 9d1495f9ee Fix typo.
9 years ago
noname@inventati.org c569e3146e Remove 'slide' variable in tresize.
9 years ago
noname@inventati.org 39ae1a4de5 Move tresize comments around.
9 years ago
noname@inventati.org 6352502d64 tresize: move for loop outside if
9 years ago
noname@inventati.org b9390a5496 Simplify loop condition.
9 years ago
noname@inventati.org d2937b05ae Remove unnecessary XFilterEvent call.
9 years ago
noname@inventati.org d3e0f3444b Use do..while in window mapping loop.
9 years ago
Omar Sandoval ecac5ee35e Make DECSCUSR thickness configurable
9 years ago
noname 93b54cfcc4 Use MAX macro where possible.
9 years ago
noname 6f5f770186 Remove 'xloadfontset' function.
9 years ago
noname 6524f022f7 Remove keywords from function definitions.
9 years ago
noname 9305f3c184 Remove variable names from function declarations.
9 years ago
Roberto E. Vargas Caballero 5bb90125c8 Remove redundant control check
9 years ago
noname 69d1fe06a9 Fixed STR sequence termination condition
9 years ago
Roberto E. Vargas Caballero 288f80cb06 Remove strsep() call
9 years ago
Roberto E. Vargas Caballero c9357a8edf Merge remote-tracking branch 'origin/master'
9 years ago
LemonBoy 580302f317 Support the DECSCUSR CSI escape sequence
9 years ago
Christoph Lohmann 246c3481d7 arg.h wasn't used for dist.
9 years ago
Alex Pilon b341e51351 Handle pasting of empty selection.
9 years ago
Roberto E. Vargas Caballero 86d1e432a8 Support XA_STRING in notify request
9 years ago
Christoph Lohmann c7e24e44c8 TODO: Fix fontconfig
9 years ago
Christoph Lohmann 5406e655da Add the new selection shortcuts to the manpage.
9 years ago
Christoph Lohmann 72d2accc22 Glibc wants me to use _DEFAULT_SOURCe. I do obey.
9 years ago
Christoph Lohmann 2fcfea1bf1 Add Mod + Shift + c/v and no selclear.
9 years ago
Roberto E. Vargas Caballero b746816b78 Allow combinations with Backspace
9 years ago
Alexander Huemer 4f60751440 FAQ: fix wording
9 years ago
Ivan Delalande f5075a9e9d Backspace value shouldn't depend on keypad state
9 years ago
Christoph Lohmann c87d45466b Merge branch 'master' of ssh://suckless.org/gitrepos/st
9 years ago
Christoph Lohmann 28259f5750 St now does only set PRIMARY on selection.
9 years ago
Alexander Huemer adeb2e95d6 FAQ: fix wording
9 years ago
Christoph Lohmann 9494362d0b Fixing the C reading test.
9 years ago
Christoph Lohmann cf1fcc4d96 Change the FAQ for the new Backspace behaviour.
9 years ago
Christoph Lohmann 230d0c8428 Finally resolving the backspace problem.
9 years ago
Christoph Lohmann b0bddc694a Add a hack to handle unknown chars in fontconfig.
9 years ago
Johannes Postma 487bbb24d0 Update kdch1 definition to three octal digits.
9 years ago
Roberto E. Vargas Caballero 29619a1a35 Small improvements to the FAQ
9 years ago
Greg Reagle b8804f9f67 document keys in man page
9 years ago
Ivan Delalande 1b514048b2 Let curses do the dirty work for flash
9 years ago
Roberto E. Vargas Caballero 3604445ffc Comment default CC assignment
9 years ago
Roberto E. Vargas Caballero ac11bbb03b Update dates in LICENSE
9 years ago
Nils Reuße c5f1d74fd8 Update year in usage()
9 years ago
Nils Reuße 7dd24bfb4c Fix crash on font resize resize
9 years ago
Rian Hunter aba6c292af Correct shift amount on MODE_INSERT in tputc()
9 years ago
Rian Hunter 4d14d97547 Fix crash due to wide characters
9 years ago
Ivan Delalande 708b697ed7 Fix crash due to invalid timespec given to pselect
10 years ago
Ivan Delalande 09f5d98251 Trim trailing whitespaces in every selection case
10 years ago
sin 4418939dd9 Call _exit() instead of exit() if exec*() fails
10 years ago
Eric Pruitt bafbba56cd Check for presence of SHELL environment variable
10 years ago
czarkoff@gmail.com 11625c7166 Replace character with U+FFFD if wcwidth() is -1
10 years ago
Quentin Rameau 008aae541b Avoid failing when embedding with a Window id of 0
10 years ago
Christoph Lohmann cd159883d1 Reverting smacs and rmacs to the xterm defaults.
10 years ago
Roberto E. Vargas Caballero f9fb620914 Do not set SHELL to utmp ever
10 years ago
CustaiCo 86633ada91 patch for bell in st
10 years ago
Roberto E. Vargas Caballero dcfe505d3c Use G1 for alternate charset
10 years ago
Roberto E. Vargas Caballero 88429cdcbf Add LS2 and LS3
10 years ago
Roberto E. Vargas Caballero 0c8feecbf7 Fix SI and SO
10 years ago
Christoph Lohmann a7eef8f230 Removing an extra space.
10 years ago
Christoph Lohmann 63a07eb19c Minor style changes for the last patch.
10 years ago
Christoph Lohmann dc8c5c82aa Implementing xzoomreset.
10 years ago

129
FAQ

@ -1,12 +1,14 @@
## Why does st not handle utmp entries?
Use the excellent tool of [utmp](http://git.suckless.org/utmp/) for this task.
Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task.
## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever!
It means that st doesnt have any terminfo entry on your system. Chances are
you did not `make install`. If you just want to test it without installing it,
you can manualy run `tic -s st.info`.
you can manually run `tic -sx st.info`.
## Nothing works, and nothing is said about an unknown terminal!
@ -15,19 +17,21 @@ you can manualy run `tic -s st.info`.
* Some programs dont complain about the lacking st description and default to
another terminal. In that case see the question about terminfo.
## I get some weird glitches/visual bug on _random program_!
Try launching it with a different TERM: $ TERM=xterm myapp. toe(1) will give
you a list of available terminals, but youll most likely switch between xterm,
st or st-256color. The default value for TERM can be changed in config.h
(TNAME).
## How do I scroll back up?
Using a terminal multiplexer.
* Using a terminal multiplexer.
* `st -e tmux` using C-b [
* `st -e screen` using C-a ESC
* Using the excellent tool of [scroll](https://git.suckless.org/scroll/).
* Using the scrollback [patch](https://st.suckless.org/patches/scrollback/).
## I would like to have utmp and/or scroll functionality by default
You can add the absolute patch of both programs in your config.h
file. You only have to modify the value of utmp and scroll variables.
* `st -e tmux` using C-b [
* `st -e screen` using C-a ESC
## Why doesn't the Del key work in some programs?
@ -51,7 +55,7 @@ solution for them is to use the following command:
$ printf '\033[?1h\033=' >/dev/tty
or
$ echo $(tput smkx) >/dev/tty
$ tput smkx
In the case of bash, readline is used. Readline has a different note in its
manpage about this issue:
@ -84,24 +88,31 @@ If you are using zsh, then read the zsh FAQ
Putting these lines into your .zshrc will fix the problems.
## How can I use meta in 8bit mode?
St supports meta in 8bit mode, but the default terminfo entry doesn't
use this capability. If you want it, you have to use the 'st-meta' value
in TERM.
St supports meta in 8bit mode, but the default terminfo entry doesn't
use this capability. If you want it, you have to use the 'st-meta' value
in TERM.
## I cannot compile st in OpenBSD
OpenBSD lacks of librt, despite it begin mandatory in POSIX
OpenBSD lacks librt, despite it being mandatory in POSIX
<http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html#tag_20_11_13>.
If you want to compile st for OpenBSD you have to remove -lrt from config.mk, and
st will compile without any loss of functionality, because all the functions are
included in libc on this platform.
## Backspace key does not work
## The Backspace Case
St is emulating the Linux way of handling backspace being delete and delete being
backspace.
This is an issue that was discussed in suckless mailing list
<http://lists.suckless.org/dev/1404/20697.html>:
<https://lists.suckless.org/dev/1404/20697.html>. Here is why some old grumpy
terminal users wants its backspace to be how he feels it:
Well, I am going to comment why I want to change the behaviour
of this key. When ASCII was defined in 1968, communication
@ -155,3 +166,85 @@ This is an issue that was discussed in suckless mailing list
[1] http://www.ibb.net/~anne/keyboard.html
[2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
## But I really want the old grumpy behaviour of my terminal
Apply [1].
[1] https://st.suckless.org/patches/delkey
## Why do images not work in st using the w3m image hack?
w3mimg uses a hack that draws an image on top of the terminal emulator Drawable
window. The hack relies on the terminal to use a single buffer to draw its
contents directly.
st uses double-buffered drawing so the image is quickly replaced and may show a
short flicker effect.
Below is a patch example to change st double-buffering to a single Drawable
buffer.
diff --git a/x.c b/x.c
--- a/x.c
+++ b/x.c
@@ -732,10 +732,6 @@ xresize(int col, int row)
win.tw = col * win.cw;
win.th = row * win.ch;
- XFreePixmap(xw.dpy, xw.buf);
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
- XftDrawChange(xw.draw, xw.buf);
xclear(0, 0, win.w, win.h);
/* resize to new width */
@@ -1148,8 +1144,7 @@ xinit(int cols, int rows)
gcvalues.graphics_exposures = False;
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
&gcvalues);
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
+ xw.buf = xw.win;
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
@@ -1632,8 +1627,6 @@ xdrawline(Line line, int x1, int y1, int x2)
void
xfinishdraw(void)
{
- XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w,
- win.h, 0, 0);
XSetForeground(xw.dpy, dc.gc,
dc.col[IS_SET(MODE_REVERSE)?
defaultfg : defaultbg].pixel);
## BadLength X error in Xft when trying to render emoji
Xft makes st crash when rendering color emojis with the following error:
"X Error of failed request: BadLength (poly request too large or internal Xlib length error)"
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 20 (RenderAddGlyphs)
Serial number of failed request: 1595
Current serial number in output stream: 1818"
This is a known bug in Xft (not st) which happens on some platforms and
combination of particular fonts and fontconfig settings.
See also:
https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6
https://bugs.freedesktop.org/show_bug.cgi?id=107534
https://bugzilla.redhat.com/show_bug.cgi?id=1498269
The solution is to remove color emoji fonts or disable this in the fontconfig
XML configuration. As an ugly workaround (which may work only on newer
fontconfig versions (FC_COLOR)), the following code can be used to mask color
fonts:
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
Please don't bother reporting this bug to st, but notify the upstream Xft
developers about fixing this bug.

@ -1,16 +1,19 @@
MIT/X Consortium License
© 2014-2020 Hiltjo Posthuma <hiltjo at codemadness dot org>
© 2018 Devin J. Pohly <djpohly at gmail dot com>
© 2014-2017 Quentin Rameau <quinq at fifth dot space>
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>
© 2009 Anselm R Garbe <garbeam at gmail dot com>
© 2012-2014 Roberto E. Vargas Caballero <k0ga at shike2 dot com>
© 2012-2014 Christoph Lohmann <20h at r-36 dot net>
© 2008-2017 Anselm R Garbe <garbeam at gmail dot com>
© 2012-2017 Roberto E. Vargas Caballero <k0ga at shike2 dot com>
© 2012-2016 Christoph Lohmann <20h at r-36 dot net>
© 2013 Eon S. Jeon <esjeon at hyunmu dot am>
© 2013 Alexander Sedov <alex0player at gmail dot com>
© 2013 Mark Edgar <medgar123 at gmail dot com>
© 2013 Eric Pruitt <eric.pruitt at gmail dot com>
© 2013-2014 Eric Pruitt <eric.pruitt at gmail dot com>
© 2013 Michael Forney <mforney at mforney dot org>
© 2013-2014 Markus Teich <markus dot teich at stusta dot mhn dot de>
© 2014 Laslo Hunhold <dev at frign dot de>
© 2014-2015 Laslo Hunhold <dev at frign dot de>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

@ -1,60 +1,57 @@
# st - simple terminal
# See LICENSE file for copyright and license details.
.POSIX:
include config.mk
SRC = st.c
OBJ = ${SRC:.c=.o}
SRC = st.c x.c
OBJ = $(SRC:.c=.o)
all: options st
options:
@echo st build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
@echo "CFLAGS = $(STCFLAGS)"
@echo "LDFLAGS = $(STLDFLAGS)"
@echo "CC = $(CC)"
config.h:
cp config.def.h config.h
.c.o:
@echo CC $<
@${CC} -c ${CFLAGS} $<
$(CC) $(STCFLAGS) -c $<
${OBJ}: config.h config.mk
st.o: config.h st.h win.h
x.o: arg.h config.h st.h win.h
st: ${OBJ}
@echo CC -o $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
$(OBJ): config.h config.mk
st: $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
clean:
@echo cleaning
@rm -f st ${OBJ} st-${VERSION}.tar.gz
rm -f st $(OBJ) st-$(VERSION).tar.gz
dist: clean
@echo creating dist tarball
@mkdir -p st-${VERSION}
@cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 ${SRC} st-${VERSION}
@tar -cf st-${VERSION}.tar st-${VERSION}
@gzip st-${VERSION}.tar
@rm -rf st-${VERSION}
install: all
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f st ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/st
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
mkdir -p st-$(VERSION)
cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
st-$(VERSION)
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
rm -rf st-$(VERSION)
install: st
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f st $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
tic -sx st.info
@echo Please see the README file regarding the terminfo entry of st.
@tic -s st.info
uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/st
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/st.1
rm -f $(DESTDIR)$(PREFIX)/bin/st
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
.PHONY: all options clean dist install uninstall

@ -24,7 +24,7 @@ Running st
If you did not install st with make clean install, you must compile
the st terminfo entry with the following command:
tic -s st.info
tic -sx st.info
See the man page for additional details.

@ -11,6 +11,7 @@ code & interface
drawing
-------
* add diacritics support to xdraws()
* switch to a suckless font drawing library
* make the font cache simpler
* add better support for brightening of the upper colors
@ -18,7 +19,6 @@ bugs
----
* fix shift up/down (shift selection in emacs)
* fix -e handling
* remove DEC test sequence when appropriate
misc

39
arg.h

@ -10,8 +10,8 @@ extern char *argv0;
/* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][1]\
&& argv[0][0] == '-';\
argv[0] && argv[0][0] == '-'\
&& argv[0][1];\
argc--, argv++) {\
char argc_;\
char **argv_;\
@ -21,43 +21,30 @@ extern char *argv0;
argc--;\
break;\
}\
for (brk_ = 0, argv[0]++, argv_ = argv;\
argv[0][0] && !brk_;\
argv[0]++) {\
int i_;\
for (i_ = 1, brk_ = 0, argv_ = argv;\
argv[0][i_] && !brk_;\
i_++) {\
if (argv_ != argv)\
break;\
argc_ = argv[0][0];\
argc_ = argv[0][i_];\
switch (argc_)
/* Handles obsolete -NUM syntax */
#define ARGNUM case '0':\
case '1':\
case '2':\
case '3':\
case '4':\
case '5':\
case '6':\
case '7':\
case '8':\
case '9'
#define ARGEND }\
}
#define ARGC() argc_
#define ARGNUMF(base) (brk_ = 1, estrtol(argv[0], (base)))
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
((x), abort(), (char *)0) :\
(brk_ = 1, (argv[0][1] != '\0')?\
(&argv[0][1]) :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
(char *)0 :\
(brk_ = 1, (argv[0][1] != '\0')?\
(&argv[0][1]) :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#endif

@ -5,13 +5,25 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
static int borderpx = 2;
static char shell[] = "/bin/sh";
static char *utmp = NULL;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
static char vtiden[] = "\033[?6c";
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
@ -20,20 +32,29 @@ static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: " `'\"()[]{}"
* More advanced example: L" `'\"()[]{}"
*/
static char worddelimiters[] = " ";
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
static bool allowaltscreen = true;
int allowaltscreen = 1;
/* frames per second st should at maximum draw to the screen */
static unsigned int xfps = 120;
static unsigned int actionfps = 30;
/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8;
static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
@ -41,17 +62,36 @@ static unsigned int actionfps = 30;
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* TERM value */
static char termname[] = "st-256color";
static unsigned int tabspaces = 8;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
@ -79,46 +119,86 @@ static const char *colorname[] = {
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
};
/*
* Default colors (colorname index)
* foreground, background, cursor
* foreground, background, cursor, reverse cursor
*/
static unsigned int defaultfg = 7;
static unsigned int defaultbg = 0;
unsigned int defaultfg = 7;
unsigned int defaultbg = 0;
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
/*
* Default shape of cursor
* 2: Block ("")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("")
*/
static unsigned int cursorshape = 2;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/*
* Colors used, when the specific fg == defaultfg. So in reverse mode this
* will reverse too. Another logic would only make the simple feature too
* complex.
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static unsigned int defaultitalic = 11;
static unsigned int defaultunderline = 7;
/* Internal mouse shortcuts. */
/* Beware that overloading Button1 will disable the selection. */
static Mousekey mshortcuts[] = {
/* button mask string */
{ Button4, XK_ANY_MOD, "\031" },
{ Button5, XK_ANY_MOD, "\005" },
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} },
{ MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
/*
@ -136,10 +216,6 @@ static Shortcut shortcuts[] = {
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
* crlf value
* * 0: no value
* * > 0: crlf mode is enabled
* * < 0: crlf mode is disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
@ -158,207 +234,221 @@ static KeySym mappedkeys[] = { -1 };
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/* Override mouse-select while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it. */
static uint forceselmod = ShiftMask;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor crlf */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\177", +1, 0, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1},
{ XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0, -1},
{ XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0, -1},
{ XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
{ XK_Delete, XK_ANY_MOD, "\177", +1, 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1, 0},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
{ XK_End, ControlMask, "\033[J", -1, 0, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0},
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
@ -372,3 +462,11 @@ static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

@ -1,28 +1,35 @@
# st version
VERSION = 0.5
VERSION = 0.8.4
# Customize below to fit your system
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
MANPREFIX = $(PREFIX)/share/man
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
PKG_CONFIG = pkg-config
# includes and libs
INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
`pkg-config --libs fontconfig` \
`pkg-config --libs freetype2`
INCS = -I$(X11INC) \
`$(PKG_CONFIG) --cflags fontconfig` \
`$(PKG_CONFIG) --cflags freetype2`
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_XOPEN_SOURCE=600
CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS}
LDFLAGS += -g ${LIBS}
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
# compiler and linker
CC ?= cc
# 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

123
st.1

@ -3,23 +3,50 @@
st \- simple terminal
.SH SYNOPSIS
.B st
.RB [ \-a ]
.RB [ \-aiv ]
.RB [ \-c
.IR class ]
.RB [ \-f
.IR font ]
.RB [ \-g
.IR geometry ]
.RB [ \-i ]
.RB [ \-n
.IR name ]
.RB [ \-o
.IR file ]
.RB [ \-t
.IR iofile ]
.RB [ \-T
.IR title ]
.RB [ \-w
.RB [ \-t
.IR title ]
.RB [ \-l
.IR line ]
.RB [ \-w
.IR windowid ]
.RB [ \-v ]
.RB [ \-e
.IR command ...]
.RB [[ \-e ]
.IR command
.RI [ arguments ...]]
.PP
.B st
.RB [ \-aiv ]
.RB [ \-c
.IR class ]
.RB [ \-f
.IR font ]
.RB [ \-g
.IR geometry ]
.RB [ \-n
.IR name ]
.RB [ \-o
.IR iofile ]
.RB [ \-T
.IR title ]
.RB [ \-t
.IR title ]
.RB [ \-w
.IR windowid ]
.RB \-l
.IR line
.RI [ stty_args ...]
.SH DESCRIPTION
.B st
is a simple terminal emulator.
@ -45,28 +72,93 @@ for further details.
.B \-i
will fixate the position given with the -g option.
.TP
.BI \-o " file"
.BI \-n " name"
defines the window instance name (default $TERM).
.TP
.BI \-o " iofile"
writes all the I/O to
.I file.
.I iofile.
This feature is useful when recording st sessions. A value of "-" means
standard output.
.TP
.BI \-T " title"
defines the window title (default 'st').
.TP
.BI \-t " title"
defines the window title (default 'st').
.TP
.BI \-w " windowid"
embeds st within the window identified by
embeds st within the window identified by
.I windowid
.TP
.BI \-l " line"
use a tty
.I line
instead of a pseudo terminal.
.I line
should be a (pseudo-)serial device (e.g. /dev/ttyS0 on Linux for serial port
0).
When this flag is given
remaining arguments are used as flags for
.BR stty(1).
By default st initializes the serial line to 8 bits, no parity, 1 stop bit
and a 38400 baud rate. The speed is set by appending it as last argument
(e.g. 'st -l /dev/ttyS0 115200'). Arguments before the last one are
.BR stty(1)
flags. If you want to set odd parity on 115200 baud use for example 'st -l
/dev/ttyS0 parenb parodd 115200'. Set the number of bits by using for
example 'st -l /dev/ttyS0 cs7 115200'. See
.BR stty(1)
for more arguments and cases.
.TP
.B \-v
prints version information to stderr, then exits.
.TP
.BI \-e " program " [ " arguments " "... ]"
.BI \-e " command " [ " arguments " "... ]"
st executes
.I program
.I command
instead of the shell. If this is used it
.B must be the last option
on the command line, as in xterm / rxvt.
This option is only intended for compatibility,
and all the remaining arguments are used as a command
even without it.
.SH SHORTCUTS
.TP
.B Break
Send a break in the serial line.
Break key is obtained in PC keyboards
pressing at the same time control and pause.
.TP
.B Ctrl-Print Screen
Toggle if st should print to the
.I iofile.
.TP
.B Shift-Print Screen
Print the full screen to the
.I iofile.
.TP
.B Print Screen
Print the selection to the
.I iofile.
.TP
.B Ctrl-Shift-Page Up
Increase font size.
.TP
.B Ctrl-Shift-Page Down
Decrease font size.
.TP
.B Ctrl-Shift-Home
Reset to default font size.
.TP
.B Ctrl-Shift-y
Paste from primary selection (middle mouse button).
.TP
.B Ctrl-Shift-c
Copy the selected text to the clipboard selection.
.TP
.B Ctrl-Shift-v
Paste from the clipboard selection.
.SH CUSTOMIZATION
.B st
can be customized by creating a custom config.h and (re)compiling the source
@ -76,7 +168,10 @@ See the LICENSE file for the authors.
.SH LICENSE
See the LICENSE file for the terms of redistribution.
.SH SEE ALSO
.BR tabbed (1)
.BR tabbed (1),
.BR utmp (1),
.BR stty (1),
.BR scroll (1)
.SH BUGS
See the TODO file in the distribution.

3469
st.c

File diff suppressed because it is too large Load Diff

125
st.h

@ -0,0 +1,125 @@
/* See LICENSE for license details. */
#include <stdint.h>
#include <sys/types.h>
/* macros */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
#define LEN(a) (sizeof(a) / sizeof(a)[0])
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d))
#define DEFAULT(a, b) (a) = (a) ? (a) : (b)
#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \
(a).bg != (b).bg)
#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
(t1.tv_nsec-t2.tv_nsec)/1E6)
#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
#define IS_TRUECOL(x) (1 << 24 & (x))
enum glyph_attribute {
ATTR_NULL = 0,
ATTR_BOLD = 1 << 0,
ATTR_FAINT = 1 << 1,
ATTR_ITALIC = 1 << 2,
ATTR_UNDERLINE = 1 << 3,
ATTR_BLINK = 1 << 4,
ATTR_REVERSE = 1 << 5,
ATTR_INVISIBLE = 1 << 6,
ATTR_STRUCK = 1 << 7,
ATTR_WRAP = 1 << 8,
ATTR_WIDE = 1 << 9,
ATTR_WDUMMY = 1 << 10,
ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
};
enum selection_mode {
SEL_IDLE = 0,
SEL_EMPTY = 1,
SEL_READY = 2
};
enum selection_type {
SEL_REGULAR = 1,
SEL_RECTANGULAR = 2
};
enum selection_snap {
SNAP_WORD = 1,
SNAP_LINE = 2
};
typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef uint_least32_t Rune;
#define Glyph Glyph_
typedef struct {
Rune u; /* character code */
ushort mode; /* attribute flags */
uint32_t fg; /* foreground */
uint32_t bg; /* background */
} Glyph;
typedef Glyph *Line;
typedef union {
int i;
uint ui;
float f;
const void *v;
const char *s;
} Arg;
void die(const char *, ...);
void redraw(void);
void draw(void);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
void ttyhangup(void);
int ttynew(char *, char *, char *, char **);
size_t ttyread(void);
void ttyresize(int, int);
void ttywrite(const char *, size_t, int);
void resettitle(void);
void selclear(void);
void selinit(void);
void selstart(int, int, int);
void selextend(int, int, int, int);
int selected(int, int);
char *getsel(void);
size_t utf8encode(Rune, char *);
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(char *);
/* config.h globals */
extern char *utmp;
extern char *scroll;
extern char *stty_args;
extern char *vtiden;
extern wchar_t *worddelimiters;
extern int allowaltscreen;
extern int allowwindowops;
extern char *termname;
extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;

@ -1,5 +1,5 @@
st| simpleterm,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
st-mono| simpleterm monocolor,
acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
am,
bce,
bel=^G,
@ -10,7 +10,7 @@ st| simpleterm,
civis=\E[?25l,
clear=\E[H\E[2J,
cnorm=\E[?12l\E[?25h,
colors#8,
colors#2,
cols#80,
cr=^M,
csr=\E[%i%p1%d;%p2%dr,
@ -25,6 +25,7 @@ st| simpleterm,
cuu=\E[%p1%dA,
dch=\E[%p1%dP,
dch1=\E[P,
dim=\E[2m,
dl=\E[%p1%dM,
dl1=\E[M,
ech=\E[%p1%dX,
@ -32,7 +33,7 @@ st| simpleterm,
el=\E[K,
el1=\E[1K,
enacs=\E)0,
flash=\E[?5h\E[?5l,
flash=\E[?5h$<80/>\E[?5l,
fsl=^G,
home=\E[H,
hpa=\E[%i%p1%dG,
@ -53,7 +54,7 @@ st| simpleterm,
ka3=\E[5~,
kc1=\E[4~,
kc3=\E[6~,
kbs=\010,
kbs=\177,
kcbt=\E[Z,
kb2=\EOu,
kcub1=\EOD,
@ -73,7 +74,7 @@ st| simpleterm,
kri=\E[1;2A,
kclr=\E[3;5~,
kdl1=\E[3;2~,
kdch1=\0177,
kdch1=\E[3~,
kich1=\E[2~,
kend=\E[4~,
kf1=\EOP,
@ -142,14 +143,13 @@ st| simpleterm,
khome=\E[1~,
kil1=\E[2;5~,
krmir=\E[2;2~,
kich1=\E[2~,
knp=\E[6~,
kmous=\E[M,
kpp=\E[5~,
lines#24,
mir,
msgr,
ncv#3,
npc,
op=\E[39;49m,
pairs#64,
mc0=\E[i,
@ -158,6 +158,7 @@ st| simpleterm,
rc=\E8,
rev=\E[7m,
ri=\EM,
rin=\E[%p1%dT,
ritm=\E[23m,
rmacs=\E(B,
rmcup=\E[?1049l,
@ -168,13 +169,8 @@ st| simpleterm,
rs1=\Ec,
rs2=\E[4l\E>\E[?1034l,
sc=\E7,
setab=\E[4%p1%dm,
setaf=\E[3%p1%dm,
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr0=\E[0m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
sitm=\E[3m,
sgr0=\E[0m,
smacs=\E(0,
smcup=\E[?1049h,
smir=\E[4h,
@ -185,13 +181,34 @@ st| simpleterm,
tsl=\E]0;,
xenl,
vpa=\E[%i%p1%dd,
# XTerm extensions
rmxx=\E[29m,
smxx=\E[9m,
# disabled rep for now: causes some issues with older ncurses versions.
# rep=%p1%c\E[%p2%{1}%-%db,
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
Tc,
Ms=\E]52;%p1%s;%p2%s\007,
Se=\E[2 q,
Ss=\E[%p1%d q,
st| simpleterm,
use=st-mono,
colors#8,
setab=\E[4%p1%dm,
setaf=\E[3%p1%dm,
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
st-256color| simpleterm with 256 colors,
use=st,
ccc,
colors#256,
oc=\E]104\007,
pairs#32767,
# Nicked from xterm-256color
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
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,
@ -210,3 +227,13 @@ st-meta-256color| simpleterm with meta key and 256 colors,
smm=\E[?1034h,
rs2=\E[4l\E>\E[?1034h,
is2=\E[4l\E>\E[?1034h,
st-bs| simpleterm with backspace as backspace,
use=st,
kbs=\010,
kdch1=\177,
st-bs-256color| simpleterm with backspace as backspace and 256colors,
use=st-256color,
kbs=\010,
kdch1=\177,

40
win.h

@ -0,0 +1,40 @@
/* See LICENSE for license details. */
enum win_mode {
MODE_VISIBLE = 1 << 0,
MODE_FOCUSED = 1 << 1,
MODE_APPKEYPAD = 1 << 2,
MODE_MOUSEBTN = 1 << 3,
MODE_MOUSEMOTION = 1 << 4,
MODE_REVERSE = 1 << 5,
MODE_KBDLOCK = 1 << 6,
MODE_HIDE = 1 << 7,
MODE_APPCURSOR = 1 << 8,
MODE_MOUSESGR = 1 << 9,
MODE_8BIT = 1 << 10,
MODE_BLINK = 1 << 11,
MODE_FBLINK = 1 << 12,
MODE_FOCUS = 1 << 13,
MODE_MOUSEX10 = 1 << 14,
MODE_MOUSEMANY = 1 << 15,
MODE_BRCKTPASTE = 1 << 16,
MODE_NUMLOCK = 1 << 17,
MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\
|MODE_MOUSEMANY,
};
void xbell(void);
void xclipcopy(void);
void xdrawcursor(int, int, Glyph, int, int, Glyph);
void xdrawline(Line, int, int, int);
void xfinishdraw(void);
void xloadcols(void);
int xsetcolorname(int, const char *);
void xseticontitle(char *);
void xsettitle(char *);
int xsetcursor(int);
void xsetmode(int, unsigned int);
void xsetpointermotion(int);
void xsetsel(char *);
int xstartdraw(void);
void xximspot(int, int);

2063
x.c

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save