374 Commits
Author SHA1 Message Date
Christoph Lohmann df62d3dab8 0.3 release. 2012-11-02 20:08:27 +01:00
Christoph Lohmann d92ad64017 Make it possible to use the corefont font description too. It is not very
useful, but easy to implement.
2012-11-02 20:07:11 +01:00
Christoph Lohmann dcf0955466 Moving to the dwm config.h variable usage. 2012-11-02 19:56:02 +01:00
Christoph Lohmann 48389be574 Adding a FAQ to reference utmp(1). 2012-10-31 20:36:32 +01:00
Christoph Lohmann d84e2978c2 Cleaning up the TODO file. 2012-10-31 20:35:07 +01:00
Christoph Lohmann cb9d92ce51 Removing the now senseless comment in config.def.h. Thanks to bnwe! 2012-10-28 14:13:39 +01:00
Christoph Lohmann 32173a11b4 Applying the patch of the little girl <yui@blekksprut.net> to make cjk input
possible. Thanks!
2012-10-28 13:37:11 +01:00
Christoph Lohmann 7168d85f97 Applying the tab expansion patch from koga. 2012-10-28 13:35:00 +01:00
Christoph Lohmann 53eda6d525 Adding a more flexible fontstring handling, shortcuts and a zoom function. 2012-10-28 13:25:53 +01:00
Christoph Lohmann 91804d7227 Applying the patch of Roberto Caballero to set WINDOWID and all the pwuid()
variables. Thanks! xinit() and ttynew() had to be switched in their
call-appearance. Otherwise xw.win is not set.
2012-10-28 06:54:08 +01:00
Christoph Lohmann 4abecf9ce4 Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego@gmail.com> to
not emulate the vt100 behaviour of selecting all whitespaces. Thanks!
2012-10-28 06:32:54 +01:00
Roberto E. Vargas Caballero 5de1468554 Add error control to iofile
write can write less bytes than we request, so it is necessary check the
return value, in case of error print a message and don't continnue writing
in the file.
---
 st.c |   39 ++++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)
2012-10-28 06:27:42 +01:00
Christoph Lohmann ab40392d08 Well, I was confused. Damn state exams. Instead of discussing this shit I
should really learn opthalmology instead. :O
2012-10-09 19:40:37 +02:00
Christoph Lohmann fa952e1901 If there is really someone without SHELL set, help him/her. 2012-10-09 19:33:26 +02:00
Roberto E. Vargas Caballero 5967a7c0db Add DEC alignment test
This sequence was used by DEC personal in to for verifying the screen adjust
of terminals. It is the unique test sequence implemented by all the
emulators, and I think it is because they want be conforms with vttest which
uses this sequence in some tests.
---
 st.c |   31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)
2012-10-07 11:06:17 +02:00
Roberto E. Vargas Caballero d627351429 Avoid initialization of vt100_0 in each call to tsetchar
If vt100_0 is a automatic variable then it is initializated in each call to
tsetchar, but if the variable is static it is initializated only in compile
time.
---
 st.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
2012-10-07 11:06:08 +02:00
Roberto E. Vargas Caballero 976b34d1fc Fix Identification sequences
Do not send NUL character in the identification (use (sizeof(VT102ID) - 1),
and finish  the sequence once you execute it.
---
 st.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
2012-10-07 11:06:00 +02:00
Roberto E. Vargas Caballero f0ee36878c Add DA and DECID sequences
These sequences are used by the host in order to can detect which kind of
terminal is connected. St will answer like a vt102 terminal with this patch.
---
 st.c |    9 +++++++++
 1 file changed, 9 insertions(+)
2012-10-06 21:19:56 +02:00
Christoph Lohmann a90662fdcf Fixing a typo. 2012-10-06 21:02:25 +02:00
Christoph Lohmann 852db9e9b0 Fixing a off-by-one error in the new border clearing code. 2012-10-06 20:52:22 +02:00
Roberto E. Vargas Caballero a9092bc48b Print control codes only in graphic mode
Non handled codes must be ignored, except in graphic mode. Also STR
sequences have higher priority than control codes, so they must be handled
before of them.
---
 st.c |  160 ++++++++++++++++++++++++++++++++++++------------------------------
 1 file changed, 87 insertions(+), 73 deletions(-)
2012-10-06 19:15:30 +02:00
Roberto E. Vargas Caballero 506b8ea0c6 Add SI and SO control codes
SI and SO allows change the G0 and G1 selection. This implementation is not
full vt100 compatible, but it is complatible with linux virtual terminal
implementation. For full vt100 compatibility we need remake a lot of stuff
relate to the different charmaps.
---
 st.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
2012-10-06 19:13:36 +02:00
Roberto E. Vargas Caballero 3fce3392ac Add SUB and CAN control codes
These control codes reset any escape sequence already initialised.
---
 st.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
2012-10-06 19:13:08 +02:00
Roberto E. Vargas Caballero 70aeaf7f2f Add documentation to control codes
Add the documentation from the vt100 manual programmer:

Control 	Octal      Action Taken
Character	Code
-------------------------------------------
NUL		000	Ignored on input (not stored in input buffer;
			see full duplex protocol).
ENQ		005	Transmit answerback message.
BEL		007	Sound bell tone from keyboard.
BS		010	Move the cursor to the left one character position,
			unless it is at the left margin,
			in which case no action occurs.
HT		011	Move the cursor to the next tab stop,
			or to the right margin if no further tab stops
			are present on the line.
LF		012	This code causes a line feed or
			a new line operation. (See new line mode).
VT		013	Interpreted as LF.
FF		014	Interpreted as LF.
CR		015	Move cursor to the left margin on the current line.
SO		016	Invoke G1 character set, as designated by SCS
			control sequence.
SI		017	Select G0 character set, as selected by ESC ( sequence.
XON		021	Causes terminal to resume transmission.
XOFF		023	Causes terminal to stop transmitted all codes
			except XOFF and XON.
CAN		030	If sent during a control sequence, the sequence is
			immediately terminated and not executed. It also causes
			the error character to be displayed.
SUB		032	Interpreted as CAN.
ESC		033	Invokes a control sequence.
DEL		177	Ignored on input (not stored in input buffer).
--------------------------------------------
---
 st.c |   28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
2012-10-06 19:12:46 +02:00
Christoph Lohmann ec9fe428b8 Forgot to remove the xclearborders() definition from the last commit. 2012-10-06 13:45:14 +02:00
Christoph Lohmann 82437818c5 Removing the xclearborders() hack. St now cleans up the parts of the border,
if something needs to be drawn close to it.
2012-10-06 13:43:01 +02:00
Christoph Lohmann b86451bf74 The style inquisition was here. Yes, making it a unified style. The last
infidels will be squashed too!
2012-10-06 09:58:45 +02:00
Christoph Lohmann b9f239abe6 Adding the patch of David Dufberg Töttrup to implement WM_DELETE_WINDOW. Thank you! 2012-10-05 22:59:08 +02:00
Christoph Lohmann 2549840ed7 Fixing the brightening on bold. For the 256 colors and greyscale I assumed a
reasonable solution.
2012-10-05 22:51:08 +02:00
Christoph Lohmann 0ddbb0c6cc Turning on antialias by default really makes it more unreadable. Maybe if once
the majority has bigger screens, this can be turned on by default again.
Thanks pancake, for the hint.
2012-10-05 11:07:55 +02:00
Christoph Lohmann c1ef12591b When the drawing behaviour was changed underline was not corrected.
Thanks to Peter A. Shevtsov!
2012-10-05 09:38:10 +02:00
Christoph Lohmann 639104946a This adds the fontcache dependency to try something out. Additionally the
invert mode now works as expected. In the config.def.h autohint is set to
false, so the fonts are drawn correctly, without any overlapping.
2012-10-04 22:59:45 +02:00
Christoph Lohmann 5ef7457266 Thanks to c00kiemon5ter. Not changing bold to bright colors seems to be the
right choice.
2012-10-02 12:48:55 +02:00
Christoph Lohmann b5982e284d Removing the now obsolete definitions from the config.def.h file. 2012-09-30 20:23:45 +02:00
Christoph Lohmann a07db5787a This changes -f to be the parameter for the font. Now -f is -o.
The parameters were reordered according to the alphabet too.
2012-09-30 20:23:10 +02:00
Christoph Lohmann 4497d2125c Remove the cruft of the user to have to define the different font styles. 2012-09-30 20:10:58 +02:00
Christoph Lohmann e496602135 We need all the colors to be available, so die() on some not available.
This is a new opportunity to see if X11 somewhen handled colors in a strange
way.
2012-09-29 11:23:34 +02:00
Christoph Lohmann 15cd4ff84a All xcolors are not Xft colors and the clearing of the borders has been
optimized. There is a speedup when resizing windows.
2012-09-29 11:17:16 +02:00
Christoph Lohmann 5e5c3b8cf3 Vt escape sequences allow escape sequences in escape sequences and escape
sequences, so we have to support escape sequences in escape sequences that
escape sequences in escape sequences – setting a title won't notify you
anymore.
2012-09-27 19:28:44 +02:00
Roberto E. Vargas Caballero bcbf5156be Allow control characters inside escape sequences
Taken from vt100 manual programmer:

	Control characters (codes \0 to \37 inclusive) are specifically
	excluded from the control sequence syntax, but may be embedded
	within a control sequence. Embedded control characters are executed
	as soon as they are encountered by the VT100. The processing of the
	control sequence then continues with the next character received.
---
 st.c |   68 +++++++++++++++++++++++++++++++++---------------------------------
 1 file changed, 34 insertions(+), 34 deletions(-)
2012-09-26 20:55:18 +02:00
Roberto E. Vargas Caballero 18e2def342 Ignore all control characters not handled
Taken from vt100 programmer manual:

	Control characters have values of \000 - \037, and \177. The control
	characters recognized by the VT100 are shown in Table 3-10. All
	other control codes cause no action to be taken.

We have to take attention when we are using alternate charset, because in
this cases they are not used as control characters.
---
 st.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
2012-09-26 20:53:46 +02:00
Christoph Lohmann 1ad0b11415 Switching to Liberation Mono as default solely because of line drawing. A next
patch to fix the font symbols in all fonts should make it easier to choose a
better font.
2012-09-26 20:21:59 +02:00
Christoph Lohmann 23d1b03d4e Implementing line drawing right. 2012-09-26 20:21:08 +02:00
Christoph Lohmann d8cf33c207 A reset should reset the line drawing too. 2012-09-25 21:39:25 +02:00
Christoph Lohmann efe3937183 Enabling enacs and adding compatibility to xterm and urxvt for alternative
charsets.
2012-09-25 21:17:43 +02:00
Roberto E. Vargas Caballero 2ca5d9463d Fix bug in tputc writing to io file
If -f options is enabled then tputc() writes all the data to a file. Actual
code assumes that all the strings in 'c' parameters have always 1 byte
length, but this is not always true, because due to utf-8 encoding some
characters can have a diferent length. So it is necessary pass string length
to tputc in order it can call to write() correctly.
---
 st.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
2012-09-25 21:04:35 +02:00
Christoph Lohmann 33eaeacaa4 Changing the default font to DejaVu Sans Mono, which is more appealing and
activating antialiasing.
2012-09-24 14:01:59 +02:00
Christoph Lohmann d68253ec75 The xinit() call needs to be behind all the tty init, otherwise all the
allocated structures are wrong. The xclear() is now done on purpose. Please
keep X11 calls out of the way of pure tty-related calls.
2012-09-24 11:04:26 +02:00
Christoph Lohmann 71fc293de2 Adding a TODO for xft fallback. 2012-09-24 10:31:35 +02:00
Roberto E. Vargas Caballero 656c43b4c7 Add some documentetion to tsetmode
The names of the terminal modes supported by vt102 are (taken from the VT220
programmer reference manual):

Table 4-7 ANSI-Standardized Modes
Name  Mnemonic		    Parameter (Ps)
Error (ignored)		    -         0 (3/0)
Keyboard action		    KAM	      2 (3/2)
Insert/replace		    IRM	      4 (3/4)
Send/receive		    SRM	      12 (3/1 3/2)
Line feed/new line	    LNM       20 (3/2 3/0)

Table 4-8 ANSI-Compatible DEC Private Modes
Name  Mnemonic		  Parameter (Ps)
Error (ignored)		  -	    0 (3/0)
Cursor key		  DECCKM    1 (3/1)
ANSI/VT52		  DECANM    2 (3/2)
Column			  DECCOLM   3 (3/3)
Scroll			  DECSCLM   4 (3/4)
Screen			  DECSCNM   5 (3/5)
Origin			  DECOM	    6 (3/6)
Auto wrap		  DECAWM    7 (3/7)
Auto repeat		  DECARM    8 (3/8)
Printer form feed	  DECPFF    18 (3/1 3/8)
Printer extent		  DECPEX    19 (3/1 3/9)
Text cursor enable	  DECTCEM   25 (3/2 3/5)
National replacement character sets DECNRCM 42 (3/4 3/2)

This patch adds a comment for each one of these sequences.
---
 st.c |   26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)
2012-09-24 10:29:37 +02:00
Roberto E. Vargas Caballero 448a25dbc8 Fix LNM sequence
LNM sequence is a standard ANSI mode, not a DEC private mode.
---
 st.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
2012-09-24 10:28:35 +02:00
Roberto E. Vargas Caballero 4dfbf487bf Add KAM sequence
This sequence lock/unlock the keyboard ignoring all the key pressing events
from X server.
---
 st.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
2012-09-24 10:28:05 +02:00
Roberto E. Vargas Caballero e2fbd25f51 Remove unused parameters in ttyresize
---
 st.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
2012-09-24 10:27:22 +02:00
Roberto E. Vargas Caballero 57e9f03059 Clear X window in tsetreset()
tsetreset() is called when it is necessary a full initialization of the
terminal, so it also should clean the full X window and not only the
terminal content. It is necessary change the order of the
initialization in main(), and put xinit before of tnew(), because tnew()
calls to tsetreset(), and  this can cause a call to xreset() with
incorrect values.
---
 st.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
2012-09-24 10:26:50 +02:00
Christoph Lohmann 61ffa628ff Merging xft and current st heads. 2012-09-24 10:24:36 +02:00
Christoph Lohmann a0b0b8f694 Initial Xft support for st. More to follow. 2012-09-24 10:20:45 +02:00
Aurélien Aptel eb837afafa use typedef'd unsigned type and regular bool type. 2012-09-19 16:03:16 +02:00
Aurélien Aptel 3f482f4758 config.def.h: typo in comment. 2012-09-18 19:13:19 +02:00
Aurélien Aptel d181afe094 LEGACY: typo. 2012-09-18 19:08:03 +02:00
Christoph Lohmann 9c7579deea Redrawing is fixed. 2012-09-17 23:14:40 +02:00
Christoph Lohmann 8b0167b596 Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too. 2012-09-17 22:44:27 +02:00
Roberto E. Vargas Caballero 5e32f3c2f4 Clean windows display after resizing
Some times the size after a resizing is not an exact multiply of a number of
characters, so redrawn the screen using the lines and columns of the neww
size can cause that some old graphics keep in the screen. Solution is clean
all the windows with the background color.
---
 st.c |    3 +++
 1 file changed, 3 insertions(+)
2012-09-17 22:13:17 +02:00
Roberto E. Vargas Caballero 40be64cff8 Copy non set positions as spaces
st selection don't insert in the selection position whose value is not
set. This is correct for the positions in the end of the line, but cause
some problems in the beginning. For example echo -e 'a\tb' will print in the
screen:

a	b

but after selecting and copying in some place you get:

ab

because positions from 1 to 7 don't have any value. This patch deals all
positions without value as blank (even at the end of the line).
---
 st.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
2012-09-17 22:13:09 +02:00
Roberto E. Vargas Caballero 63cab32d05 Add newline in error messages
---
 st.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
2012-09-17 22:11:28 +02:00
Roberto E. Vargas Caballero cf7edb2641 Add xcalloc wrapper
malloc and realloc are called through xmalloc and xrealloc, so calloc should
be called through xcalloc.
---
 st.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
2012-09-17 22:11:20 +02:00
Christoph Lohmann 8a9c8b7502 Applying a shortening proposal for the run loop of k0ga. 2012-09-16 20:43:51 +02:00
Roberto E. Vargas Caballero 7d54d35a95 Remove call to draw in resize
In previous commits draw was removed from all the X events, but I forgot do
it in resize.
---
 st.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
2012-09-16 14:02:35 +02:00
Christoph Lohmann 1c316bedce Adding some more fields to the manpage, like authors, license etc. 2012-09-16 13:59:10 +02:00
Christoph Lohmann 851b15293a Remove some solved issues and add some new. 2012-09-16 13:50:07 +02:00
Christoph Lohmann d41d383aad Preliminary solution to the stuttering problem. 2012-09-16 13:22:23 +02:00
Roberto E. Vargas Caballero 6bf6ef46f2 Fix selection bug
After the commit named "Remove timeout in the main loop", selection is not
working in the proper way. After selecting something, press mouse button in
a line outside of selection causes an incorrect highlight. This patch fix
the problem forcing a draw after the press event, but this is only a fast
hack. Real solution means rewriting selection code.
---
 st.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
2012-09-16 10:49:12 +02:00
Roberto E. Vargas Caballero c624bb5703 Render only once in each main loop iteration
draw() runs over all lines of the screen and renders only the dirty lines,
this avoids render lines which are not modified since last draw() call. In
this moment the main loop is something like:

     - Wait something to read from file descriptors
     - Read from pseudo tty
     - Call draw() for rending
     - Read X events

This cause the problem that all the X events that have to update the screen
have to call draw() (because draw() is called before of X events handling),
so you can have multiples renderings in only one iteration, that will waste
a lot of resources.

This patch change the main loop to:

     - Wait something to read from file descriptors
     - Read from pseudo tty
     - Read X events
     - Call draw() for rending

So X events don't have to worry about rendering, because draw() is called
after them.

The only place where draw is called outside of the main loop is in redraw(),
but it is necessary for getting a good tput flash.
---
 st.c |   29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)
2012-09-16 10:48:38 +02:00
Roberto E. Vargas Caballero f3704e6553 Remove timeout in the main loop
The main loop waits until there is some data to read in file descriptors of
the X server or the pseudo tty. But it uses a timeout in select(), which
causes that st awake each 20 ms, even it doesn't have something to do. This
patch removes this problem removing the timeout, which is not needed.
---
 TODO |    1 -
 st.c |   27 +++------------------------
 2 files changed, 3 insertions(+), 25 deletions(-)
2012-09-16 10:47:21 +02:00
Roberto E. Vargas Caballero 9c04eb529f Call XSync in redraw
It is necessary call to XSync if you want a good tput flash, because in
other way you can not be sure that white screen will be shown.
---
 st.c |    1 +
 1 file changed, 1 insertion(+)
2012-09-16 10:46:08 +02:00
Roberto E. Vargas Caballero 6b42002e1a Call XdbeQueryExtension before of calling any Xdbe function
XdbeQueryExtension() tells to the caller if the Xdbe extension is present in
the X server, so it should be called for sanity. But like is said in
XdbeQueryExtension(3):

	No other Xdbe functions may be called before this function.  If a
	client violates this rule, the effects of all subsequent Xdbe calls
	that it makes are undefined.

it is mandatory call this function.
---
 st.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
2012-09-16 10:45:36 +02:00
Christoph Lohmann dccba949b5 Implementing italic-bold. This will require an increase of the avgWdth. 2012-09-14 19:46:07 +02:00
Christoph Lohmann 30e167c457 Ignore NUL character as a padding character. Telnet may use this. Patch of
Roberto Vargas.
2012-09-13 23:21:40 +02:00
Christoph Lohmann 184c38c88b Importing the patch of Roberto Vargas to inherit signal handlers. 2012-09-13 23:19:57 +02:00
Christoph Lohmann 12516e2181 Reset window title on terminal reset too. 2012-09-13 07:16:38 +02:00
Christoph Lohmann 81283df211 Adding a statemant on legacy support. 2012-09-13 07:04:59 +02:00
Christoph Lohmann 42ebd8ef7f Adding another bold off sequence. 2012-09-13 07:04:34 +02:00
Roberto E. Vargas Caballero d254935875 Remove buffering to fileio instead of calling fflush
By default text files are line buffered, and this means that -f option will
not write the line until a \n is printed. This is not very useful for
debugging, so a call to fflush was added. This patch substitute this call
(which will be done by each character painted) by the full remove of the
buffering in the file.
---
 st.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
2012-09-12 21:51:55 +02:00
Roberto E. Vargas Caballero adc4631574 Add xmalloc and xrealloc wrappers
If malloc  or realloc fail they return NULL. Theorically this condition
should be tested in the code, but it's a strange condition today (basically
if this is hapenning thenyou have a big problem), and even Linux never returns
NULL in the default configuration (only if the process don't have room in
the space address, something a bit impossible in the case of st). But stis
enough small for being executed in low resources computers where this can be
a real problem. So the easy way is creating a wrappers function for them and
call to die in case of error.
---
 st.c |   44 +++++++++++++++++++++++++++++++-------------
 1 file changed, 31 insertions(+), 13 deletions(-)
2012-09-12 21:25:35 +02:00
Christoph Lohmann 91d32161fc Make nyancat(1) work. Important release feature! 2012-09-12 13:20:10 +02:00
Christoph Lohmann 04b6bee980 Add preliminary blink stubs. Real implementation is still missing. 2012-09-12 13:08:26 +02:00
Christoph Lohmann 1e334a1469 Add another obscure way to set a window title. 2012-09-12 13:00:39 +02:00
Christoph Lohmann 10cb169ede Fixing the too small window in non-tiling window managers. 2012-09-10 13:39:41 +02:00
Christoph Lohmann e5588098c0 Making the selection work again. 2012-09-06 08:02:56 +02:00
Christoph Lohmann 25cdfc8483 Allow simpler stdout -f handling. 2012-09-06 00:00:50 +02:00
Christoph Lohmann b576d2c551 Adding instantenous debug output and fixing italic with a reset. 2012-09-05 23:38:57 +02:00
Christoph Lohmann f48c2b1484 Adding the removal of the timeouts to the TODO. 2012-09-05 23:06:59 +02:00
Christoph Lohmann fd7f78f2c7 Removing masks for unhandled enter and leaving events. 2012-09-05 22:39:09 +02:00
Christoph Lohmann 001b0152a4 If the selection is cleared, draw() and do it on button press too. 2012-09-05 22:17:42 +02:00
Roberto E. Vargas Caballero 62c5abf2a7 Unhighlight selection when selection is owner by other window
st marks the active selection using reverse colors in the box selection, but
once that another window becomes owner of the selection, it is very
confusing that st keeps highlight the old selection. Usually terminal
emulators remove the highlight when it is not valid anymore.

X sends a SelectionClear event in this situation, so we only have to add a
callback which unhighlight the selectin box.
---
 st.c |    9 +++++++++
 1 file changed, 9 insertions(+)
2012-09-05 21:55:45 +02:00
Christoph Lohmann a683de5364 Forcing the parameter limit to xcopy() and selpaste(). Thanks to Rob Pilling. 2012-09-05 21:54:52 +02:00
Christoph Lohmann d0973d19da Removing unneeded arguments to copy(). Thanks to Andrew Hills. 2012-09-05 21:52:01 +02:00
Christoph Lohmann f5c6bcf03a Implement italic font support. 2012-09-05 21:48:26 +02:00
Christoph Lohmann 0e0a7f9130 Add to TODO to make function keys work. 2012-09-05 01:32:42 +02:00
Christoph Lohmann c238dbae5f Enable keypad set and unset commands. 2012-09-05 01:25:37 +02:00
Christoph Lohmann 245a6418b4 Disable BCE again. 2012-09-05 00:58:17 +02:00
Christoph Lohmann 1afbb7799f Removing the resize issue from the TODO file. 2012-09-05 00:09:13 +02:00
Christoph Lohmann 76a86e1612 Fixing the resizing behaviour. 2012-09-05 00:08:13 +02:00
Christoph Lohmann a9550744b5 Forgot one line. It's late. 2012-09-04 22:51:29 +02:00
Christoph Lohmann b9567a9b18 Cleaning up the fixed window size and the resizing of clients. 2012-09-04 22:44:33 +02:00
Christoph Lohmann 6cd52d6c2f Another thing for TODO – resize. 2012-09-04 22:06:54 +02:00
Christoph Lohmann 7815df826a Updating the TODO and enabling BCE. 2012-09-04 22:05:24 +02:00
Christoph Lohmann 870be23e28 CUP == HVP; CHA == HPA; 2012-09-04 21:56:55 +02:00
Christoph Lohmann 1f7896ae9c Unifying the old style. 2012-09-04 20:34:43 +02:00
Roberto E. Vargas Caballero ec8262e106 Check alternative screen before drawing box selection
Some programs use the alternative screen (vi, less, ...), whose
content is different of the main screen. If you select text in one of
the screen, you don't wait the box selection is painted in the other
screen, so it is necessary check if the selection was done in the same
screen we are going to paint. Before to this commit, you could do
something like:

	$ LESS="" ls | less
	(select some code)
	q

and selection box remains drawing in the main screen, but the content
of selection keeps text of the alternate screen.
---
 st.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
2012-09-04 20:33:01 +02:00
Roberto E. Vargas Caballero 684a6b59ee Add newline to stderr message
---
 st.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
2012-09-04 20:31:21 +02:00
Christoph Lohmann 59eaf3ce56 Fixing the border pixel when there is a negative position. 2012-09-03 23:09:34 +02:00
Christoph Lohmann 31c71cddb9 Add -g geometry to st and the manpage. 2012-09-03 23:02:29 +02:00
Christoph Lohmann 07c282d229 Fixing a type in in2 in the st.info. 2012-09-03 21:54:40 +02:00
Roberto E. Vargas Caballero e135e96f35 Force redisplay of all lines in DECSCNM
When it is called DECSCNM all lines become dirty, because it is necessary
redraw all lines for getting the new colors. It is easy see the problem
running 'echo ^[[?5h'.

In order to get a correct flash when running tput flash is necessary wait
after DECSCNM, until the changes are displayed, because in other case the
switch between reverse on/reverse off will be too much fast and nothing will
happen.
---
 st.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
2012-09-03 21:52:34 +02:00
Roberto E. Vargas Caballero ee4a9934ab Add write I/O to file
This is a theorical feature listed in http://st.suckless.org/goals. All the
input/output of the terminal will be written to a file, which can be very
useful for debugging, and also allow interconnect st to other process
through named pipes.
---
 st.1 |    6 ++++++
 st.c |   14 +++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
2012-09-03 21:52:21 +02:00
Christoph Lohmann eeb26ec316 Patch from Roberto Vargas. »Add initialization strings in terminfo«
Taken from the description:

When tput init is executed the list of task performed are (taken from
terminfo(5)):

              run the program
                     iprog

              output is1 is2

              set the margins using
                     mgc, smgl and smgr

              set tabs using
                     tbc and hts

              print the file
                     if

              and finally
                     output is3.

When reset is executed, a more stronger initialization process is performed,
so the terminal can return from an unknown state. rs1, rs2 and rs3 are used
in this case instead of
using is1, is2 and is3.

This patch makes is2 = rs2, resets insert mode and set normal keypad
mode. For rs1 it performs a full initilization using ^[c.
2012-09-03 21:50:22 +02:00
Christoph Lohmann b3d8986489 Add standout mode. 2012-09-02 19:53:50 +02:00
Christoph Lohmann 6f336ce8f2 Cleaning up lonely tabs. 2012-09-02 19:43:29 +02:00
Christoph Lohmann e2f6df0d17 Make it more obvious where the wrong attribute is used. 2012-09-02 19:42:00 +02:00
Roberto E. Vargas Caballero 7988713b35 Enable multiple arguments in SM and RM
SM and RM can receive multiple parameters, but the code only was accepting
only one. This patch join the code of set and reset modes (SM and RM) in a
common function and uses a loop which deals with all the arguments of the
sequence. This patch improves xterm and vt100 compability.
---
 st.c |  180 ++++++++++++++++++++++++++++--------------------------------------
 1 file changed, 76 insertions(+), 104 deletions(-)
2012-09-02 19:09:35 +02:00
Roberto E. Vargas Caballero 499671f3bf Add vpa terminfo capability
---
 st.info |    2 ++
 1 file changed, 2 insertions(+)
2012-09-02 19:08:52 +02:00
Christoph Lohmann 1da81ff23e Silencing the compiler but keeping strparse.
This will really be needed when there is a full 256 color support.
2012-08-30 21:19:53 +02:00
Christoph Lohmann 4675c14758 Applying the CBT patch of Roberto Vargas. Thanks. 2012-08-30 21:17:54 +02:00
Christoph Lohmann 1175c4be7a Never trust terminfo fata morganas. And adding other xterm compatibility. 2012-08-30 07:38:47 +02:00
Christoph Lohmann 06963a1dc7 Add OSC, DSC, PM, APC and settitle. 2012-08-29 23:14:20 +02:00
Christoph Lohmann 5843cbeae7 Adding setb and setf and a comment about terminfo installation. 2012-08-29 21:13:47 +02:00
Roberto E. Vargas Caballero 6590664fa0 Add CHT sequence
This sequence performs "Cursor Forward Tabulation <n> tab stops", which
although is not present in vt100 or vt102, xterm accepts it.
---
 st.c |    5 +++++
 1 file changed, 5 insertions(+)
2012-08-29 20:05:25 +02:00
Christoph Lohmann e049533ca7 Applying the patches of k0ga and changing the LICENSE file in the appropriate
way.
2012-08-29 20:01:34 +02:00
Roberto E. Vargas Caballero 67d809776f Add TBC sequence
This sequence clears tab stops in the terminal. If the argument is not present
or is zero, then removes the tab stop of the current horizontal position. If
the argument is 3 then removes all the tab stops of the terminal. It was
necessary modify the terminfo entry tbc, because it has \E[2g instead of the
correct \E[3g.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
---
 st.c    |   12 ++++++++++++
 st.info |    2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
2012-08-29 19:59:47 +02:00
Roberto E. Vargas Caballero 94ce8a7184 Add HTS sequence
This sequence adds a new tab stop in the current horizontal position. This
means that tputtab must be look for the next tab stop in the tabs array
instead of using a hard coded value offset. Also, CHT sequence XXX message
is removed because it is not a vt10x sequence (as far as I know it is a
vt50x sequence), and it is not implemented by linux virtual terminal neither
by xterm.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
---
 st.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
2012-08-29 19:59:43 +02:00
Roberto E. Vargas Caballero 2d061761f9 Add tabs field into Term struct
Tabs stop are simulated in st using a fixed size of 8, always, without be
worried about sequences changing the tab stops. A user can put a tab stop in
each horizontal position of the screen, so we need at least one flag for
each column of the screen. In the same way as dirty flags is used for the
rows, it is used a bool dinamic array.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
---
 st.c |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
2012-08-29 19:59:37 +02:00
Brandon Invergo 4eeb3aded3 apply post-XDBE patch BORDER fix 2012-08-03 14:46:40 +02:00
Brandon Invergo 9e48ff64e2 Implement Xdbe-based double-buffering 2012-07-28 14:27:26 +02:00
Aurélien Aptel 5991c6d7d3 update TODO. 2012-02-27 12:48:13 +01:00
Aurélien Aptel 0e2bd2db06 cleanup. refactored dirt-related function. 2012-02-27 12:44:02 +01:00
Aurélien Aptel 62c5a5a60a use SHELL as default shell. 2012-02-16 19:24:46 +01:00
Aurélien Aptel 332c2a22fb revert to "tip" in VERSION. 2012-02-16 01:06:45 +01:00
Aurélien Aptel 012f7fac29 Added tag 0.2.1 for changeset 108926a0fe61 2012-02-16 01:05:26 +01:00
Aurélien Aptel 80a46b1270 bump version. 2012-02-16 01:05:14 +01:00
Aurélien Aptel 664c40f6bc replace fwrite by printf. 2012-02-16 00:59:26 +01:00
Aurélien Aptel 6cd5c3dab7 rewrite csidump(). 2012-02-16 00:58:16 +01:00
Aurélien Aptel 8ebab41592 clean and name enum definitions. 2012-02-16 00:33:11 +01:00
Aurélien Aptel 1ec0515e75 fix default color overwriten bug. 2012-02-16 00:10:32 +01:00
Aurélien Aptel adf5d2e32a show dark cursor when unfocused. 2012-02-15 19:33:48 +01:00
Aurélien Aptel 62d380947e document possible configuration. 2012-02-15 19:11:07 +01:00
Aurélien Aptel 5705e5dfd1 handle dim/bright colors. 2012-02-15 19:10:31 +01:00
Aurélien Aptel 45971204a2 merge 2012-02-13 01:01:41 +01:00
anselm@garbe.us e478f91c10 some minor fixes 2012-02-11 10:48:18 +01:00
Aurélien Aptel 284430538d reduce size of each glyph for faster copy. 2012-02-08 16:45:52 +01:00
Aurélien Aptel c7ed0d1bad Added tag 0.2 for changeset 3c2f9f2ab5e4 2012-02-07 23:53:45 +01:00
Aurélien Aptel ae0966484c cosmetic, whitespace, etc. 2012-01-21 23:43:03 +01:00
Aurélien Aptel 156ce77645 fix PRINT/DRAW _TIMEOUT and fix redrawing bug. 2012-01-21 23:26:53 +01:00
Aurélien Aptel 96c22e1604 copy dirty lines to screen, add select() timeout & min time between draw() calls.
* add a timeout value (SELECT_TIMEOUT) of 20ms in the select() call
* wait at least 20ms (DRAW_TIMEOUT) between draw() calls
* only copy dirty lines from the buffer to the screen

what draw() does:
* clears dirty lines in the buffer
* draws the longest same-attributes string of each
  dirty line to the buffer with multiple xdraws() call
* copies the current dirty line from buffer to the screen with a single
  xcopy() call

this changeset makes st run ~10x faster.
2012-01-21 23:14:41 +01:00
Aurélien Aptel 281174445b fix segfault in selection. (thx Martti Kühne) 2012-01-10 22:21:03 +01:00
Aurélien Aptel 197c466864 merge. 2011-11-01 16:37:16 +01:00
Aurélien Aptel 5ca0d3d2fa fix selection. (thx Tarmo Heiskanen) 2011-11-01 16:33:43 +01:00
Aurélien Aptel b1b9dc7eb5 drawregion() only copies region on screen. 2011-10-20 23:26:58 +02:00
Aurélien Aptel 44c83397af add dirty flag for lines 2011-10-20 23:20:59 +02:00
Aurélien Aptel 7c350025b2 no palette limit (thx Nick) 2011-10-06 21:32:34 +02:00
Aurélien Aptel 4a421ffbbc simplify version format. 2011-09-22 10:04:58 +02:00
Aurélien Aptel 62a92ca1aa selection is removed or scrolled properly. (thx Rafa Garcia Gallego) 2011-09-16 18:48:16 +02:00
Aurélien Aptel 98042a1a2d working on old repo, merging recent changesets. 2011-09-16 18:24:13 +02:00
Aurélien Aptel 5c6df8b3c3 move xembedatom in XWindow struct, add link to xembed specs. 2011-09-16 18:21:48 +02:00
Aurélien Aptel 43a4c5ebb2 tweak focus to support XEMBED client message and remove focus on EnterNotify. (thx Adrian) 2011-09-16 18:03:44 +02:00
Aurélien Aptel bf2e23f535 remove dup of default window size. 2011-09-16 17:57:56 +02:00
Aurélien Aptel 5d1c52bf5c change "op" cap in terminfo entry to xterm/rxvt value. 2011-08-14 17:15:19 +02:00
Aurélien Aptel 54adc7ee50 fix custom key handling. 2011-08-14 17:13:59 +02:00
Aurélien Aptel e2809f3976 fix focus state when embed in another window. 2011-06-09 18:25:56 +02:00
Aurélien Aptel ce547d3060 fix segfault with mouse selection. (thx anonymous) 2011-06-09 14:27:07 +02:00
Aurélien Aptel 4259a3ba3a add -w option to embed st. (thx nodus cursorius) 2011-06-08 21:35:58 +02:00
Aurélien Aptel fb32d01a18 applied parts of "anonymous" cleanup patch. 2011-06-08 20:26:00 +02:00
Aurélien Aptel 986670d080 add altscreen escseq alias & caps to terminfo entry. (thx Bert Münnich) 2011-06-08 20:22:38 +02:00
Aurélien Aptel 6eaec4732f disable mouse highlight when mouse report enabled. (thx Bert Münnich) 2011-06-08 19:32:10 +02:00
Aurélien Aptel 2edb412b6b reverse video mode. (thx Bert Münnich) 2011-06-08 12:40:35 +02:00
Aurélien Aptel bf6a11a482 add status bar (window title) to terminfo. (thx Rafa Gallego) 2011-06-01 19:57:48 +02:00
Aurélien Aptel a05423cb6a set title before mapping window (thx Kamil Cholewiński). 2011-05-22 16:57:27 +02:00
Aurélien Aptel cdd993c39e applied parts of Connor Lane Smith's cleanup patch. 2011-05-14 17:47:37 +02:00
Aurélien Aptel a7f4af0139 macro cleanup. 2011-05-10 22:55:35 +02:00
Aurélien Aptel 225fc7cbcf add mouse report escape to terminfo entry. 2011-05-10 22:54:30 +02:00
Aurélien Aptel 9760a7a831 support for x11 xterm mouse reporting 2011-05-10 22:22:44 +02:00
Aurélien Aptel 9a3cc64f9d whitespace. 2011-04-26 20:29:28 +02:00
Aurélien Aptel 3d0eeac7a8 cleanup. 2011-04-26 20:22:15 +02:00
Aurélien Aptel 31ba817cc3 update TODO 2011-04-22 00:42:58 +02:00
Aurélien Aptel e4dd367a4f selection clicks, shift+arrow keys, fast(er) redraw, key mask in config.h (thx Magnus Leuthner) 2011-04-22 00:18:53 +02:00
Aurélien Aptel 043fb982c5 update README. 2011-04-03 21:40:33 +02:00
Aurélien Aptel 7f3ea64d61 quick bug-fixing 0.1.1 release. 2011-04-03 21:05:41 +02:00
Aurélien Aptel d343f5847b update VERSION. 2011-04-03 21:04:45 +02:00
Aurélien Aptel 55c8d82eb1 take BORDER into account for selection. (thx Petr Sabata) 2011-04-03 21:03:48 +02:00
Aurélien Aptel d679267c46 fix utf8 clipboard. (thx Petr Sabata) 2011-04-03 21:00:55 +02:00
Aurélien Aptel bdd3246271 Added tag 0.1 for changeset cbc18c988236 2011-04-03 02:02:31 +02:00
Aurélien Aptel dbc2a3ea0f add support for utf8 clipboard. fix usage message. 2011-04-03 00:35:02 +02:00
pancake@nopcode.org ff97be88d5 do not add newline to selection text if next line not selected (Nick) 2011-04-01 09:35:38 +02:00
pancake@nopcode.org f27e662faa remove debugging printf 2011-04-01 09:33:28 +02:00
pancake@nopcode.org 2ea66b9229 apply Nick's patch to fix some error printf to use stderr 2011-04-01 09:32:41 +02:00
Aurélien Aptel cabc2bed68 fix insert key, terminfo and changed TERM back to st. (thx Ondrej Martinek) 2011-01-23 12:30:01 +01:00
Aurélien Aptel 0d2e7feb3b change X cursor to "I". 2010-12-12 13:32:13 +01:00
Aurélien Aptel 77e8d5be18 update terminfo entry. 2010-12-08 18:41:55 +01:00
Aurélien Aptel 111a8b00a2 add new line glitch to terminfo entry. 2010-12-08 18:09:39 +01:00
Aurélien Aptel 5dd76fab8b change -e behaviour and update man page. 2010-11-30 22:55:44 +01:00
Aurélien Aptel 191e59e438 -e flag handles arguments. 2010-11-28 13:17:20 +01:00
Aurélien Aptel 0f37655939 use memmove() instead of memcpy() in ttyread(). 2010-11-28 01:40:39 +01:00
Aurélien Aptel 1551e2db46 fix and clean ttyread(). buf wasn't static. 2010-11-27 21:19:31 +01:00
Aurélien Aptel 3cf9c2736c merge. 2010-11-26 22:12:54 +01:00
Aurélien Aptel c1f5b697a8 s/xw.dis/xw.dpy/ 2010-11-26 22:11:31 +01:00
pancake@nopcode.org 94ddc3e0c4 Fix unused variable issue and OSX includes 2010-11-24 14:27:44 +01:00
Aurélien Aptel 37f079e063 cleanup & bugfix in xdraws(). 2010-11-20 22:24:04 +01:00
Aurélien Aptel 58a650f089 clean comment regarding redrawing in bmotion(). 2010-11-19 22:32:39 +01:00
Gregor Best e417230f38 Add -c option to override the default window class 2010-11-19 17:13:13 +01:00
Aurélien Aptel 0735e8e760 some code cleaning. 2010-11-18 12:43:33 +01:00
Aurélien Aptel db3a27c8e6 utf8 support! print text in delicious unicode greatness! all hail to the glorious Damian Okrasa for the patch!
TERM set back to xterm.
changed default fonts.
Note: drawing is now (even) slower.
2010-11-18 01:00:04 +01:00
Aurélien Aptel f8d22ad159 selection code cleanup. 2010-11-08 19:49:13 +01:00
Aurélien Aptel 4569bab9c2 fixed ED. 2010-10-31 20:29:22 +01:00
Devin J. Pohly ea4d528fb9 redraw if we scroll on resize 2010-10-25 16:45:13 -04:00
Devin J. Pohly 221a683ef2 get rid of artifacts in border on resize down 2010-10-25 16:00:10 -04:00
Devin J. Pohly 90a56203a0 copy old pixmap to new on resize 2010-10-25 15:26:47 -04:00
Devin J. Pohly a6790adae7 move code into new xresize func, add early exit to resize 2010-10-25 15:10:41 -04:00
Aurélien Aptel f2388b19b9 \v and \f are have the same behaviour of \n. 2010-10-16 20:54:19 +02:00
Aurélien Aptel 311dd6952b added LNM mode; re-organized kpress() to handle it. 2010-10-16 20:50:29 +02:00
Aurélien Aptel 53bdabe24a redraw optimization. 2010-10-16 17:13:22 +02:00
Aurélien Aptel 5822a9fe61 fixed newline bug. 2010-10-14 19:21:12 +02:00
Aurélien Aptel 9daaad2214 replaced memset by loops in tresize(); turns out it's faster. 2010-10-13 01:27:09 +02:00
Aurélien Aptel b7d01d9b5c remove useless draw(). 2010-10-13 01:25:04 +02:00
Aurélien Aptel 32cae5475a applied xclipboard patch. thx David Isaac Wolinsky. 2010-10-13 01:24:11 +02:00
Aurélien Aptel a4ee801882 clean button selection code. 2010-10-13 00:50:18 +02:00
Aurélien Aptel 9bbc040ea6 compose key patch. thx federico luna. 2010-09-21 16:04:13 +02:00
Aurélien Aptel ad918b5a0b s/hasfocus/focus/ for consistency. 2010-09-11 16:07:36 +02:00
Aurélien Aptel 047aa071f3 don't draw if the window is not visible. 2010-09-11 16:05:57 +02:00
Aurélien Aptel d3440e1e0f use xclear() in draw(). 2010-09-11 16:01:41 +02:00
Aurélien Aptel 9134535808 use XCreateWindow(), set gravity bit. 2010-09-11 15:59:54 +02:00
Aurélien Aptel 641b507220 cleaning st.info. added comment in st.c for DECSCNM. 2010-09-03 00:15:43 +02:00
Aurélien Aptel 6380a73364 cleaning st.info. fixed cvvis. 2010-09-03 00:00:41 +02:00
Aurélien Aptel a997fea2c0 set terminal colors to xterm default ones. 2010-09-02 22:35:55 +02:00
Aurélien Aptel e87203dea6 removed gfx chars not present in xterm acsc. 2010-09-02 21:59:05 +02:00
Aurélien Aptel 9c504814df fixed start/end sequence of gfx. 2010-09-02 20:24:33 +02:00
Aurélien Aptel c68dae91d2 undefined gfx doesn't draw \0. 2010-09-02 20:21:40 +02:00
Aurélien Aptel 95b236a22a fixed makefile. 2010-09-02 02:03:53 +02:00
Aurélien Aptel c762fce23c added manpage. 2010-09-02 02:02:56 +02:00
Aurélien Aptel 5c7be4ad4d resize from the top. 2010-09-02 01:42:03 +02:00
Aurélien Aptel 195aa6bb9c added -e and -t option. 2010-09-02 01:37:01 +02:00
Aurélien Aptel eef3cb4242 factored code and fixed behaviour of tnewline(). 2010-09-01 23:20:54 +02:00
Aurélien Aptel ce404f8263 updated TODO. 2010-09-01 22:54:28 +02:00
Aurélien Aptel 8e1871bf8a started to go through st.info and fix things. 2010-09-01 22:54:07 +02:00
Aurélien Aptel ffd59a1b58 capabilities sorted by capname in st.info. copy acsc from xterm. 2010-09-01 19:47:46 +02:00
Aurélien Aptel c5b2056ba9 removed debug code. 2010-09-01 18:12:54 +02:00
Aurélien Aptel 2b3f6aca5a fixed IL and DL. 2010-09-01 17:21:09 +02:00
Aurélien Aptel 8c49888622 factor and cleanup code. 2010-09-01 16:26:12 +02:00
Aurélien Aptel f2482b322a added correct line drawing characters for default font. 2010-09-01 00:30:39 +02:00
Aurélien Aptel 60df49df91 use struct instead of array. 2010-08-31 18:30:18 +02:00
Aurélien Aptel 75143af77c cleanup. 2010-08-31 18:22:59 +02:00
pancake@nopcode.org 87d1f98637 fix segfault when selecting big buffers
shift+insert paste clipboard
honor CFLAGS and LDFLAGS in config.mk
2010-08-31 17:36:55 +02:00
Aurélien Aptel 4449abbddb fix build. 2010-08-31 16:56:27 +02:00
Aurélien Aptel 1d10e7865f add selinit() and renamed clipboard_* to sel*. 2010-08-31 16:53:34 +02:00
Aurélien Aptel 639e493b95 move event configuration in xinit(). 2010-08-31 16:30:11 +02:00
Aurélien Aptel 6ee49bcd9a use one global struct instead of many vars for selection. Cleanup. 2010-08-31 15:36:13 +02:00
Aurélien Aptel 6fc43b0194 use GLYPH_SET to test if a char is set; cleanup. 2010-08-31 14:52:52 +02:00
pancake@nopcode.org 725ec8ff4a fix crash for small windows
use unconditional infinite loops
2010-08-31 11:40:57 +02:00
Aurélien Aptel 9669f718ab toggle ATTR_REVERSE on selected text, factored some code and fixed Makefile. 2010-08-31 11:02:17 +02:00
pancake ca1f6675a1 fix build
use config.def.h mechanism
add SHELL in config.h
2010-08-30 23:49:15 +02:00
pancake dcc7f842bb initial implementation of selection and clipboard 2010-08-30 23:41:37 +02:00
pancake@nopcode.org 35b33ee489 fix segfault 2010-08-30 17:07:54 +02:00
Aurélien Aptel 641dfd94e3 added support for alternate screen. 2010-08-30 16:48:18 +02:00
Aurélien Aptel af113bd3fb cursor is hid when unfocused. 2010-08-30 15:28:29 +02:00
Aurélien Aptel 4f5c7e3a31 use predefined OS macro instead of uname. 2010-08-30 13:04:19 +02:00
Aurélien Aptel 1ba065d993 st should compile on NetBSD. 2010-08-30 01:20:38 +02:00
Aurélien Aptel bc834723ec removed pty.h. minimal system guessing added in config.mk. 2010-08-30 03:12:11 +02:00
Aurélien Aptel ecca0580cb removed (visual) bell. '\a' sets the urgency flag if st is unfocused. 2010-08-30 03:05:05 +02:00
Aurélien Aptel ad2fdab6b6 removed useless cursor init. and renamed xcursor() to xdrawcursor(). 2010-08-30 01:45:57 +02:00
Aurélien Aptel 4657805ec5 added support for the "magic margin", changed c.hide to c.state, changed xcursor() to use term instead of a
parameter and fixed the cursor position after setting a scrolling region.
2010-08-30 01:35:37 +02:00
Aurélien Aptel 674926af15 removed old VT52 escapes, fixed VT100 IND. 2010-08-30 01:19:05 +02:00
pancake 70c9762434 fix warning 2010-08-30 00:32:49 +02:00
Aurélien Aptel 913c0cbd34 fixed optimized drawing routine and factored some code. 2010-08-29 20:12:44 +02:00
Aurélien Aptel 27a7d85d0c fixed pixmap buffer drawing. 2010-08-29 19:41:36 +02:00
Aurélien Aptel acf921d410 added a XFlush() in xbell(). 2010-08-29 19:14:05 +02:00
Aurélien Aptel 5299e2bfa2 moved term.hidec in term.c for consistency, put back delay in xbell()
along with duration in config.h, factored some code in tnew()/treset()
and cleaned some code.
2010-08-29 18:55:15 +02:00
Aurélien Aptel 1def7a177e merged tscroll() with tscrollup(). 2010-08-29 12:27:59 +02:00
Aurélien Aptel cf527c22d5 st now runs on Linux, OpenBSD and FreeBSD. 2010-08-28 03:18:22 +02:00
Aurélien Aptel fa6a9216a1 removed XINERAMA from config.mk and fixed a segfault when st is
started without a display. (thx Hiltjo Posthuma)
2010-08-27 13:53:27 +02:00
Aurélien Aptel fec59f7370 fixed potential bug in IS_SET(). 2010-08-27 00:58:28 +02:00
Aurélien Aptel 6f259b9257 merged tcursorwrap() with tnewline(), added few comments and updated copyright. 2010-08-27 00:28:27 +02:00
Aurélien Aptel 8db9a192e5 cleaned some spaces. 2010-08-27 00:05:50 +02:00
Aurélien Aptel 85a94e2db9 added macro to test flags, removed tmovecursor(). 2010-08-26 23:43:08 +02:00
Aurélien Aptel 8a3b1e0938 faster resizing. 2010-08-26 21:37:12 +02:00
Aurélien Aptel 1494bb9f97 close master/slave pty in the shell process. 2010-08-26 21:36:21 +02:00
Aurélien Aptel ab5e72dc39 clean \t. 2010-08-26 21:34:37 +02:00
Aurélien Aptel f181bb29d8 update function prototypes. 2010-08-26 21:33:53 +02:00
Aurélien Aptel c81ea29001 fix \b and clean \t. 2010-08-26 21:32:34 +02:00
Aurélien Aptel d1084bfdab added F1-12 key, fixed DCH and ICH. 2010-08-22 19:46:46 +02:00
Aurélien Aptel 66efdff768 fixed backspace problem, updated terminfo entry and moved TNAME in config.h. 2010-08-19 12:46:54 +02:00
Aurélien Aptel b0672d0932 renamed a function. 2010-08-13 22:43:30 +02:00
Anselm R Garbe 2bbe19f9d5 applied Devin J Pohly's st color info patches, thanks Devin! 2010-07-24 12:09:14 +01:00
pancake@nopcode.org 5f4fb527ce fix gcc warnings 2010-07-08 17:34:02 +02:00
Aurélien Aptel 1552e2f1b9 fixed background color bug (thx Devin J. Pohly). 2010-07-08 16:31:41 +02:00
Aurélien Aptel c7861318e2 added PBaseSize hint and set default title to "st". 2010-06-03 23:14:37 +02:00
Aurélien Aptel 2a28e226a9 rearranged code, resize fixed. 2010-06-02 16:01:30 +02:00
Aurélien Aptel 50d795d28c little clean up. 2010-04-27 00:04:29 +02:00
Aurélien Aptel ba9e8eafe7 use SHELL environment variable (thx Thomas Adam) 2010-04-26 19:20:53 +02:00
Aurélien Aptel ba783c4517 double-buffering added using pixmap (finally).
results in a lot of simplification :
	- no more dirty flags (perf are good enough).
	- no more ugly gfx call in emulation functions.
LINESPACE removed from config.h.
BORDER is now handled correctly.
2010-03-15 23:56:38 +01:00
Aurélien Aptel 5b945f0652 bold attribute is back.
visibility of the cursor is not saved/loaded anymore.
scrolling up/down is fixed.
added RI and RIS sequences.
fixed cursor drawing bug.
2010-03-11 23:50:50 +01:00
Aurélien Aptel 8898ecc34a added VT100 NEL. 2010-02-21 14:59:32 +01:00
Aurélien Aptel a744f2f897 added VT100 RI. 2010-02-21 14:39:31 +01:00
Aurélien Aptel 21a92b4dc9 added VT100 save&load cursor support. 2010-02-21 14:28:32 +01:00
Aurélien Aptel 8d12cb4035 ECH handled correctly. 2010-02-21 14:14:58 +01:00
Aurélien Aptel bc4b43be44 more escapes & more compability:
cursor keys are handled in kpress according to the Application Mode (DECPAM).
define & enum were renamed.
tcursor() is now tmovecursor() which is more correct.
tcpos() is now tcursor(), as DECSC is also supposed to save attributes.
capnames are indicated whenever possible.

Currently:
alsamixer looks fine, totally usable.
ncmpc is almost ok.
emacs looks like shit.
2010-02-08 23:16:55 +01:00
Aurélien Aptel fe32c542ec graphic charset and a few more escapes. 2010-02-03 16:18:04 +01:00
Aurélien Aptel 85e81bd8a6 TERM set to xterm by default (which broke a lot of stuff), better escape handling (title), and a little clean up. 2010-02-03 03:25:35 +01:00
Aurélien Aptel a2d6f50665 drawing is faster but the bold attr is not supported anymore. 2009-10-28 14:34:22 +01:00
Aurélien Aptel 7958b41040 Fixed possible segfault by reverting to the key struct (again). 2009-09-07 21:19:29 +02:00
Anselm R Garbe be0878960e only compile tdump if DEBUG flag is set 2009-07-10 16:27:14 +01:00
Anselm R Garbe 4d3b1f94c7 we definately need pixmaps for the drawing, currently drawing into the window is painfully slow! much more slower than drawing into a pixmap and mapping that when finished -- several optimisations 2009-07-10 16:23:11 +01:00
Aurélien Aptel 30024d585b reverted back to the old Key struct. 2009-06-21 19:52:06 +02:00
Aurélien Aptel 29fafafb26 updated "key" to a lookup table. 2009-06-21 19:37:12 +02:00
Aurélien Aptel b36cf286b3 removed old unused cursor() proto. 2009-06-17 20:44:36 +02:00
Aurélien Aptel c23d259eb4 fixed the scrolling bug and cleaned some stuff. 2009-06-17 02:58:40 +02:00
Aurélien Aptel bddcc7f5ae dump escseq if not handled. 2009-06-16 12:34:10 +02:00
Aurélien Aptel 0b2a2fc613 clean up. 2009-06-16 02:41:45 +02:00
Aurélien Aptel 19d9334d96 added/removed files, updated Makefile. 2009-06-16 02:33:38 +02:00
Aurélien Aptel 6305137834 made kpress() more flexible, removed st.h, added config.h. 2009-06-16 02:23:46 +02:00
Aurélien Aptel ae69ef6758 updated TODO. 2009-06-11 17:03:25 +02:00
Aurélien Aptel d8ce37bc3d added sigchld handler, cleaned error checking. 2009-06-11 16:41:14 +02:00
Aurélien Aptel 678b66897a cleaned up (removed space indentation). select/event bug fixed. 2009-05-28 01:33:01 +02:00
Aurélien Aptel 8e4ac364cb fixed a memory leak & segfault in tresize. 2009-05-26 02:21:02 +02:00
Aurélien Aptel 9224d3eaf2 updated TODO. 2009-05-15 00:40:47 +02:00
Aurélien Aptel 2fab2ea5ed tab moves the cursor instead of inserting spaces. 2009-05-15 00:39:51 +02:00
Aurélien Aptel 9364de4c64 handle tabulation (still not perfect) 2009-05-14 01:03:17 +02:00
Aurélien Aptel 28abdd24c7 removed truecolor stuff 2009-05-14 00:28:10 +02:00
Aurélien Aptel f806677a0b removed the truecolor stuff 2009-05-14 00:27:37 +02:00
Aurélien Aptel 633983cfc7 same thing, really fixed this time. 2009-05-14 00:18:05 +02:00
Aurélien Aptel e6b37f2f87 added some error checking in xinit (fixed the segfault caused by a missing font) 2009-05-14 00:04:34 +02:00
Aurélien Aptel da01ce7465 Removed unused variable and cleaned some comment. 2009-05-10 23:32:21 +02:00
Anselm R Garbe c740fb5be8 backport of local changes 2009-05-10 13:17:09 +01:00
Matthias-Christian Ott ad4256295b add accidentally omitted word 2008-09-05 20:25:34 +02:00
Matthias-Christian Ott 6bcdd0edd5 use stdio(3) 2008-08-25 17:56:00 +02:00
Matthias-Christian Ott 7e57d1fbba add description of std 2008-08-25 16:29:37 +02:00
Matthias-Christian Ott 841d2339e3 add prototype for command parsing 2008-08-07 10:38:54 +02:00
Matthias-Christian Ott 4063ddb6dc correct year of copyright notice 2008-07-21 17:10:33 +02:00
Matthias-Christian Ott db20559694 simplify Makefile
Due to consideration of POSIX compliance issues config.mk had
to be removed. Configuration variables can be overridden by
environment variables or specified via command line.

Additionally all pretty-printed messages were removed and
built-in rules are used. This also simplifies and purges
the Makefile.
2008-07-21 17:06:59 +02:00
Matthias-Christian Ott 76c66a3556 reunite pty.c with std.c 2008-07-21 10:34:02 +02:00
Matthias-Christian Ott 2346bd1d39 correct programme name 2008-07-21 09:25:47 +02:00
Matthias-Christian Ott 019a118b67 use errx() for help and version messages 2008-07-21 09:25:25 +02:00
Matthias-Christian Ott 3993557404 merge with backout head 2008-07-10 22:43:24 +02:00
Matthias-Christian Ott fbac4d5cb6 Backed out changeset d2bb4220fdf3
Ptm and pts are used by pty.c, thus they have to be non-static.
2008-07-10 22:42:10 +02:00
Matthias-Christian Ott 3333bca385 remove TODO 2008-07-09 11:10:38 +02:00
Matthias-Christian Ott 23bc536ebd make ptm and pts static 2008-07-09 10:50:44 +02:00
Matthias-Christian Ott f917857f4e remove useless variable 2008-07-05 13:29:21 +02:00
Matthias-Christian Ott eb92c4da84 remove emallocz() 2008-07-04 18:18:51 +02:00
Matthias-Christian Ott d16fdbb6fa replace eprint() functions with BSD error functions 2008-07-04 18:05:08 +02:00
Matthias-Christian Ott f757e6f839 simplify flushing 2008-06-15 17:31:24 +02:00
Matthias-Christian Ott dadd3d0a6d correct buffering 2008-06-15 09:19:22 +02:00
Matthias-Christian Ott 1bc8d0beb3 make local functions and variables static 2008-06-14 23:29:11 +02:00
Matthias-Christian Ott 7c63f47d3d add select(2)-based i/o multiplexing 2008-06-14 23:24:12 +02:00
Matthias-Christian Ott bed0807e77 drop stdio usage
Std requires I/O multiplexing which is very complicated with
stdio, because it provides no transparent buffering.
2008-06-14 23:12:07 +02:00
Matthias-Christian Ott c9e63f9c30 make st and std separate programmes 2008-06-14 11:03:29 +02:00
Matthias-Christian Ott 61f6e92f65 add missing header file 2008-06-10 18:01:15 +02:00
Matthias-Christian Ott f513f1d9da assume glibc by default 2008-06-10 18:00:15 +02:00
Matthias-Christian Ott 3e8930a7a6 source utility functions out to util.c 2008-06-10 17:56:57 +02:00
Matthias-Christian Ott df9140d050 add copyright comment 2008-06-10 17:32:15 +02:00
Matthias-Christian Ott 3f14681cd6 source getpty() out to pty.c 2008-06-10 17:30:15 +02:00
Matthias-Christian Ott 9995f245ee update TODO 2008-06-09 22:24:44 +02:00
Matthias-Christian Ott e4be8afef2 correct function name 2008-06-09 22:21:37 +02:00
Matthias-Christian Ott 9a644176d0 remove xinerama flags
The xinerama related variables in config.mk are a relict of
dwm and therefore should be removed.
2008-06-08 21:36:58 +02:00
Matthias-Christian Ott 130b90d8d0 add missing header file 2008-06-08 21:18:49 +02:00
Matthias-Christian Ott 62872197f8 add parser loop 2008-06-08 21:17:02 +02:00
Matthias-Christian Ott 19a38b1fd3 remove useless variable 2008-06-08 20:55:42 +02:00
Matthias-Christian Ott 512ca99d8c replace state with separate variables 2008-06-08 20:47:08 +02:00
Matthias-Christian Ott 538a0c4431 terminate error message with newline 2008-06-04 19:52:59 +02:00
Matthias-Christian Ott 75b1565fdc correct LENGTH() 2008-06-02 20:15:52 +02:00
Matthias-Christian Ott 4059fb04fa simplify control flow 2008-06-02 20:01:35 +02:00
Matthias-Christian Ott 1ebcc5c97b remove debug code 2008-06-02 18:42:23 +02:00
Matthias-Christian Ott 28f831b74b remove stdio slave pty opening 2008-06-02 18:41:23 +02:00
Matthias-Christian Ott 38c5ff876d drop support for proprietary UNIX variants
Proprietary UNIX variants like AIX, HP-UX or SCO UNIX
are nowadays rarely used and maintaining compatibility to
non-standard operating systems interfaces is wasteful and
practically useless.

Projects like xterm suffer from backward compatibility to decades-old
UNIX variants and terminal standards. This does not conform to st's
design goals.
2008-06-02 18:40:22 +02:00
Anselm R Garbe 2803f76fa8 slight changes 2008-06-01 18:04:49 +01:00
Anselm R Garbe d272d5a95e applied Matthias-Christians changes to std.c 2008-06-01 18:02:48 +01:00
Anselm R Garbe a4e3e95194 added some new files for the initial rewrite of st from scratch 2008-05-20 10:03:59 +01:00
arg@localhost.localdomain 9e7b36d72b added new TODO 2008-05-11 16:36:13 +00:00
15 changed files with 2175 additions and 4972 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
cbc18c988236c63a58ed24031805e8d36a3ad01a 0.1
f245ac2efd8ac2f1ac6bffae876c2663e794f79d 0.1.1
3c2f9f2ab5e433db1401047760ec31d66939b74b 0.2
108926a0fe610b92c0296148721c3225932f39aa 0.2.1
+5 -198
View File
@@ -1,201 +1,8 @@
## Why does st not handle utmp entries? --
Why does st not handle utmp entries?
Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task. Use the excellent tool of utmp[0] for this task.
## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever! [0] http://hg.suckless.org/utmp/
--
It means that st doesn’t 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 manually run `tic -sx st.info`.
## Nothing works, and nothing is said about an unknown terminal!
* Some programs just assume they’re running in xterm i.e. they don’t rely on
terminfo. What you see is the current state of the “xterm compliance”.
* Some programs don’t complain about the lacking st description and default to
another terminal. In that case see the question about terminfo.
## How do I scroll back up?
* 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.
## Why doesn't the Del key work in some programs?
Taken from the terminfo manpage:
If the terminal has a keypad that transmits codes when the keys
are pressed, this information can be given. Note that it is not
possible to handle terminals where the keypad only works in
local (this applies, for example, to the unshifted HP 2621 keys).
If the keypad can be set to transmit or not transmit, give these
codes as smkx and rmkx. Otherwise the keypad is assumed to
always transmit.
In the st case smkx=E[?1hE= and rmkx=E[?1lE>, so it is mandatory that
applications which want to test against keypad keys send these
sequences.
But buggy applications (like bash and irssi, for example) don't do this. A fast
solution for them is to use the following command:
$ printf '\033[?1h\033=' >/dev/tty
or
$ tput smkx
In the case of bash, readline is used. Readline has a different note in its
manpage about this issue:
enable-keypad (Off)
When set to On, readline will try to enable the
application keypad when it is called. Some systems
need this to enable arrow keys.
Adding this option to your .inputrc will fix the keypad problem for all
applications using readline.
If you are using zsh, then read the zsh FAQ
<http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25>:
It should be noted that the O / [ confusion can occur with other keys
such as Home and End. Some systems let you query the key sequences
sent by these keys from the system's terminal database, terminfo.
Unfortunately, the key sequences given there typically apply to the
mode that is not the one zsh uses by default (it's the "application"
mode rather than the "raw" mode). Explaining the use of terminfo is
outside of the scope of this FAQ, but if you wish to use the key
sequences given there you can tell the line editor to turn on
"application" mode when it starts and turn it off when it stops:
function zle-line-init () { echoti smkx }
function zle-line-finish () { echoti rmkx }
zle -N zle-line-init
zle -N zle-line-finish
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.
## I cannot compile st in OpenBSD
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.
## 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
<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
with computers was done using punched cards, or hardcopy
terminals (basically a typewriter machine connected with the
computer using a serial port). ASCII defines DELETE as 7F,
because, in punched-card terms, it means all the holes of the
card punched; it is thus a kind of 'physical delete'. In the
same way, the BACKSPACE key was a non-destructive backspace,
as on a typewriter. So, if you wanted to delete a character,
you had to BACKSPACE and then DELETE. Another use of BACKSPACE
was to type accented characters, for example 'a BACKSPACE `'.
The VT100 had no BACKSPACE key; it was generated using the
CONTROL key as another control character (CONTROL key sets to
0 b7 b6 b5, so it converts H (code 0x48) into BACKSPACE (code
0x08)), but it had a DELETE key in a similar position where
the BACKSPACE key is located today on common PC keyboards.
All the terminal emulators emulated the difference between
these keys correctly: the backspace key generated a BACKSPACE
(^H) and delete key generated a DELETE (^?).
But a problem arose when Linus Torvalds wrote Linux. Unlike
earlier terminals, the Linux virtual terminal (the terminal
emulator integrated in the kernel) returned a DELETE when
backspace was pressed, due to the VT100 having a DELETE key in
the same position. This created a lot of problems (see [1]
and [2]). Since Linux has become the king, a lot of terminal
emulators today generate a DELETE when the backspace key is
pressed in order to avoid problems with Linux. The result is
that the only way of generating a BACKSPACE on these systems
is by using CONTROL + H. (I also think that emacs had an
important point here because the CONTROL + H prefix is used
in emacs in some commands (help commands).)
From point of view of the kernel, you can change the key
for deleting a previous character with stty erase. When you
connect a real terminal into a machine you describe the type
of terminal, so getty configures the correct value of stty
erase for this terminal. In the case of terminal emulators,
however, you don't have any getty that can set the correct
value of stty erase, so you always get the default value.
For this reason, it is necessary to add 'stty erase ^H' to your
profile if you have changed the value of the backspace key.
Of course, another solution is for st itself to modify the
value of stty erase. I usually have the inverse problem:
when I connect to non-Unix machines, I have to press CONTROL +
h to get a BACKSPACE. The inverse problem occurs when a user
connects to my Unix machines from a different system with a
correct backspace key.
[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 (in programs such as w3m)?
This is a terrible hack that overdraws an image on top of the terminal emulator
window. It also relies on a very specific way the terminal draws it's contents.
A more proper (but limited way) would be using sixels. Which st doesn't
support.
## 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.
+25 -32
View File
@@ -1,34 +1,27 @@
MIT/X Consortium License Copyright (c) 2009-2012, Aurélien APTEL <aurelien dot aptel at gmail dot com>
Copyright (c) 2012, Roberto E. Vargas Caballero <k0ga at shike2 dot com>
Copyright (c) 2012, Christoph Lohmann <20h at r-36 dot net>
Copyright (c) 2009, Anselm R Garbe <garbeam at gmail dot com>
© 2014-2018 Hiltjo Posthuma <hiltjo at codemadness dot org> Redistribution and use in source and binary forms, with or without
© 2018 Devin J. Pohly <djpohly at gmail dot com> modification, are permitted provided that the following conditions are met:
© 2014-2017 Quentin Rameau <quinq at fifth dot space> * Redistributions of source code must retain the above copyright
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com> notice, this list of conditions and the following disclaimer.
© 2008-2017 Anselm R Garbe <garbeam at gmail dot com> * Redistributions in binary form must reproduce the above copyright
© 2012-2017 Roberto E. Vargas Caballero <k0ga at shike2 dot com> notice, this list of conditions and the following disclaimer in the
© 2012-2016 Christoph Lohmann <20h at r-36 dot net> documentation and/or other materials provided with the distribution.
© 2013 Eon S. Jeon <esjeon at hyunmu dot am> * Neither the name of the copyright holder nor the names of its
© 2013 Alexander Sedov <alex0player at gmail dot com> contributors may be used to endorse or promote products derived
© 2013 Mark Edgar <medgar123 at gmail dot com> from this software without specific prior written permission.
© 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-2015 Laslo Hunhold <dev at frign dot de>
Permission is hereby granted, free of charge, to any person obtaining a THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
copy of this software and associated documentation files (the "Software"), "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
to deal in the Software without restriction, including without limitation LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
the rights to use, copy, modify, merge, publish, distribute, sublicense, A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
and/or sell copies of the Software, and to permit persons to whom the HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Software is furnished to do so, subject to the following conditions: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
The above copyright notice and this permission notice shall be included in DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
all copies or substantial portions of the Software. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+35 -31
View File
@@ -1,57 +1,61 @@
# st - simple terminal # st - simple terminal
# See LICENSE file for copyright and license details. # See LICENSE file for copyright and license details.
.POSIX:
include config.mk include config.mk
SRC = st.c x.c SRC = st.c
OBJ = $(SRC:.c=.o) OBJ = ${SRC:.c=.o}
all: options st all: options st
options: options:
@echo st build options: @echo st build options:
@echo "CFLAGS = $(STCFLAGS)" @echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = $(STLDFLAGS)" @echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = $(CC)" @echo "CC = ${CC}"
config.h: config.h:
cp config.def.h config.h cp config.def.h config.h
.c.o: .c.o:
$(CC) $(STCFLAGS) -c $< @echo CC $<
@${CC} -c ${CFLAGS} $<
st.o: config.h st.h win.h ${OBJ}: config.h config.mk
x.o: arg.h config.h st.h win.h
$(OBJ): config.h config.mk st: ${OBJ}
@echo CC -o $@
st: $(OBJ) @${CC} -o $@ ${OBJ} ${LDFLAGS}
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
clean: clean:
rm -f st $(OBJ) st-$(VERSION).tar.gz @echo cleaning
@rm -f st ${OBJ} st-${VERSION}.tar.gz
dist: clean dist: clean
mkdir -p st-$(VERSION) @echo creating dist tarball
cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\ @mkdir -p st-${VERSION}
config.def.h st.info st.1 arg.h st.h win.h $(SRC)\ @cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 ${SRC} st-${VERSION}
st-$(VERSION) @tar -cf st-${VERSION}.tar st-${VERSION}
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz @gzip st-${VERSION}.tar
rm -rf st-$(VERSION) @rm -rf st-${VERSION}
install: st install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin @echo installing executable file to ${DESTDIR}${PREFIX}/bin
cp -f st $(DESTDIR)$(PREFIX)/bin @mkdir -p ${DESTDIR}${PREFIX}/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/st @cp -f st ${DESTDIR}${PREFIX}/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1 @chmod 755 ${DESTDIR}${PREFIX}/bin/st
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
tic -sx st.info @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
@echo Please see the README file regarding the terminfo entry of st. @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
@echo If things do not seem to work, be sure that there is no \
floating st terminfo in the .terminfo directory in your home dir.
@tic -s st.info
uninstall: uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st @echo removing executable file from ${DESTDIR}${PREFIX}/bin
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1 @rm -f ${DESTDIR}${PREFIX}/bin/st
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/st.1
.PHONY: all options clean dist install uninstall .PHONY: all options clean dist install uninstall
+6 -5
View File
@@ -1,6 +1,6 @@
st - simple terminal st - simple terminal
-------------------- --------------------
st is a simple terminal emulator for X which sucks less. st is a simple virtual terminal emulator for X which sucks less.
Requirements Requirements
@@ -21,14 +21,15 @@ necessary as root):
Running st Running st
---------- ----------
If you did not install st with make clean install, you must compile If you don't install st, define TNAME to "xterm" in config.h or make sure to at
the st terminfo entry with the following command: least compile st terminfo entry with the following command:
tic -sx st.info tic -s st.info
It should print the path of the compiled terminfo entry. You can
safely remove it if you don't plan to use st anymore.
See the man page for additional details. See the man page for additional details.
Credits Credits
------- -------
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code. Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.
+15 -10
View File
@@ -1,25 +1,30 @@
vt emulation vt emulation
------------ ------------
* double-height support * implement BCE right
* color definition in CSI
* implement CSI parsing
* make the keypad keys really work
* kf0 .. kf44
* kend, kel, kent, kfnd, ked, kext
* kNXT, kPRV
* ka1, ka3, kb2
* add arrow keys handling
code & interface code & interface
---------------- ----------------
* add a simple way to do multiplexing * clean and complete terminfo entry
* add fallback fonts for the restricted xft code
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
bugs bugs
---- ----
* handle XOpenMI() errors
* fix shift up/down (shift selection in emacs) * fix shift up/down (shift selection in emacs)
* remove DEC test sequence when appropriate * fix selection paste for xatom STRING
* fix umlaut handling in settitle
* fix rows and column definition in fixed geometry
misc misc
---- ----
-50
View File
@@ -1,50 +0,0 @@
/*
* Copy me if you can.
* by 20h
*/
#ifndef ARG_H__
#define ARG_H__
extern char *argv0;
/* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][0] == '-'\
&& argv[0][1];\
argc--, argv++) {\
char argc_;\
char **argv_;\
int brk_;\
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
argv++;\
argc--;\
break;\
}\
int i_;\
for (i_ = 1, brk_ = 0, argv_ = argv;\
argv[0][i_] && !brk_;\
i_++) {\
if (argv_ != argv)\
break;\
argc_ = argv[0][i_];\
switch (argc_)
#define ARGEND }\
}
#define ARGC() argc_
#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
((x), abort(), (char *)0) :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
(char *)0 :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#endif
+41 -405
View File
@@ -1,88 +1,19 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
/* /* appearance */
* appearance static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
* static unsigned int borderpx = 2;
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html static char shell[] = "/bin/sh";
*/
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
static int borderpx = 2;
/* /* double-click timeout (in milliseconds) between clicks for selection */
* 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 */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300; static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600; static unsigned int tripleclicktimeout = 600;
/* alt screens */ /* TERM value */
int allowaltscreen = 1; static char termname[] = "st-256color";
/* frames per second st should at maximum draw to the screen */ static unsigned int tabspaces = 8;
static unsigned int xfps = 120;
static unsigned int actionfps = 30;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
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;
/* 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) */ /* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = { static const char *colorname[] = {
@@ -110,352 +41,57 @@ static const char *colorname[] = {
/* more colors can be added after 255 to use with DefaultXX */ /* more colors can be added after 255 to use with DefaultXX */
"#cccccc", "#cccccc",
"#555555", "#333333",
}; };
/* /*
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, unfocused cursor
*/ */
unsigned int defaultfg = 7; static unsigned int defaultfg = 7;
unsigned int defaultbg = 0; static unsigned int defaultbg = 0;
static unsigned int defaultcs = 256; static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257; static unsigned int defaultucs = 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;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ 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} },
{ 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} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
/* /*
* Special keys (change & recompile st.info accordingly) * Special keys (change & recompile st.info accordingly)
* Keep in mind that kpress() in st.c hardcodes some keys.
* *
* Mask value: * Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state * * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers) * * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode 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
* position for a key.
*/ */
/* /* key, mask, output */
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = { static Key key[] = {
/* keysym mask string appkey appcursor */ { XK_BackSpace, XK_NO_MOD, "\177" },
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, { XK_Insert, XK_NO_MOD, "\033[2~" },
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, { XK_Delete, XK_NO_MOD, "\033[3~" },
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, { XK_Home, XK_NO_MOD, "\033[1~" },
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, { XK_End, XK_NO_MOD, "\033[4~" },
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, { XK_Prior, XK_NO_MOD, "\033[5~" },
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, { XK_Next, XK_NO_MOD, "\033[6~" },
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, { XK_F1, XK_NO_MOD, "\033OP" },
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, { XK_F2, XK_NO_MOD, "\033OQ" },
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, { XK_F3, XK_NO_MOD, "\033OR" },
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, { XK_F4, XK_NO_MOD, "\033OS" },
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, { XK_F5, XK_NO_MOD, "\033[15~" },
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, { XK_F6, XK_NO_MOD, "\033[17~" },
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, { XK_F7, XK_NO_MOD, "\033[18~" },
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, { XK_F8, XK_NO_MOD, "\033[19~" },
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, { XK_F9, XK_NO_MOD, "\033[20~" },
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, { XK_F10, XK_NO_MOD, "\033[21~" },
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, { XK_F11, XK_NO_MOD, "\033[23~" },
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, { XK_F12, XK_NO_MOD, "\033[24~" },
{ 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},
}; };
/* /* Internal shortcuts. */
* Selection types' masks. #define MODKEY Mod1Mask
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress. static Shortcut shortcuts[] = {
* ButtonRelease and MotionNotify. /* modifier key function argument */
* If no match is found, regular selection is used. { MODKEY|ShiftMask, XK_Prior, xzoom, {.i = +1} },
*/ { MODKEY|ShiftMask, XK_Next, xzoom, {.i = -1} },
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{|}~";
+8 -20
View File
@@ -1,35 +1,23 @@
# st version # st version
VERSION = 0.8.3 VERSION = 0.3
# Customize below to fit your system # Customize below to fit your system
# paths # paths
PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib X11LIB = /usr/X11R6/lib
PKG_CONFIG = pkg-config
# includes and libs # includes and libs
INCS = -I$(X11INC) \ INCS = -I. -I/usr/include -I${X11INC} -I/usr/include/freetype2
`$(PKG_CONFIG) --cflags fontconfig` \ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lfontconfig
`$(PKG_CONFIG) --cflags freetype2`
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
# flags # flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 CPPFLAGS = -DVERSION=\"${VERSION}\"
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) CFLAGS += -g -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
STLDFLAGS = $(LIBS) $(LDFLAGS) LDFLAGS += -g ${LIBS}
# 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 # compiler and linker
# CC = c99 CC ?= cc
+10 -116
View File
@@ -3,58 +3,26 @@
st \- simple terminal st \- simple terminal
.SH SYNOPSIS .SH SYNOPSIS
.B st .B st
.RB [ \-aiv ]
.RB [ \-c .RB [ \-c
.IR class ] .IR class ]
.RB [ \-f .RB [ \-f
.IR font ] .IR font ]
.RB [ \-g .RB [ \-g
.IR geometry ] .IR geometry ]
.RB [ \-n
.IR name ]
.RB [ \-o .RB [ \-o
.IR iofile ] .IR file ]
.RB [ \-T
.IR title ]
.RB [ \-t
.IR title ]
.RB [ \-l
.IR line ]
.RB [ \-w
.IR windowid ]
.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 .RB [ \-t
.IR title ] .IR title ]
.RB [ \-w .RB [ \-w
.IR windowid ] .IR windowid ]
.RB \-l .RB [ \-v ]
.IR line .RB [ \-e
.RI [ stty_args ...] .IR command ...]
.SH DESCRIPTION .SH DESCRIPTION
.B st .B st
is a simple terminal emulator. is a simple terminal emulator.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-a
disable alternate screens in terminal
.TP
.BI \-c " class" .BI \-c " class"
defines the window class (default $TERM). defines the window class (default $TERM).
.TP .TP
@@ -64,26 +32,14 @@ defines the
to use when st is run. to use when st is run.
.TP .TP
.BI \-g " geometry" .BI \-g " geometry"
defines the X11 geometry string. defines the X11 geometry string, which will fixate the height and width of st.
The form is [=][<cols>{xX}<rows>][{+-}<xoffset>{+-}<yoffset>]. See
.BR XParseGeometry (3)
for further details.
.TP .TP
.B \-i .BI \-o " file"
will fixate the position given with the -g option.
.TP
.BI \-n " name"
defines the window instance name (default $TERM).
.TP
.BI \-o " iofile"
writes all the I/O to writes all the I/O to
.I iofile. .I file.
This feature is useful when recording st sessions. A value of "-" means This feature is useful when recording st sessions. A value of "-" means
standard output. standard output.
.TP .TP
.BI \-T " title"
defines the window title (default 'st').
.TP
.BI \-t " title" .BI \-t " title"
defines the window title (default 'st'). defines the window title (default 'st').
.TP .TP
@@ -91,74 +47,15 @@ defines the window title (default 'st').
embeds st within the window identified by embeds st within the window identified by
.I windowid .I windowid
.TP .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 .B \-v
prints version information to stderr, then exits. prints version information to stderr, then exits.
.TP .TP
.BI \-e " command " [ " arguments " "... ]" .BI \-e " program " [ " arguments " "... ]"
st executes st executes
.I command .I program
instead of the shell. If this is used it instead of the shell. If this is used it
.B must be the last option .B must be the last option
on the command line, as in xterm / rxvt. 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 .SH CUSTOMIZATION
.B st .B st
can be customized by creating a custom config.h and (re)compiling the source can be customized by creating a custom config.h and (re)compiling the source
@@ -168,10 +65,7 @@ See the LICENSE file for the authors.
.SH LICENSE .SH LICENSE
See the LICENSE file for the terms of redistribution. See the LICENSE file for the terms of redistribution.
.SH SEE ALSO .SH SEE ALSO
.BR tabbed (1), .BR tabbed (1)
.BR utmp (1),
.BR stty (1),
.BR scroll (1)
.SH BUGS .SH BUGS
See the TODO file in the distribution. See the TODO file in the distribution.
+1988 -1736
View File
File diff suppressed because it is too large. Load diff
-124
View File
@@ -1,124 +0,0 @@
/* 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 char *termname;
extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;
+38 -151
View File
@@ -1,16 +1,18 @@
st-mono| simpleterm monocolor, # unsupported xterm caps are (getting) commented.
acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, # as soon as they work, uncomment them.
st| simpleterm,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
am, am,
bce, # bce,
bel=^G, bel=^G,
blink=\E[5m, # blink=\E[5m,
bold=\E[1m, bold=\E[1m,
cbt=\E[Z, cbt=\E[Z,
cvvis=\E[?25h, cvvis=\E[?25h,
civis=\E[?25l, civis=\E[?25l,
clear=\E[H\E[2J, clear=\E[H\E[2J,
cnorm=\E[?12l\E[?25h, cnorm=\E[?12l\E[?25h,
colors#2, colors#8,
cols#80, cols#80,
cr=^M, cr=^M,
csr=\E[%i%p1%d;%p2%dr, csr=\E[%i%p1%d;%p2%dr,
@@ -25,7 +27,6 @@ st-mono| simpleterm monocolor,
cuu=\E[%p1%dA, cuu=\E[%p1%dA,
dch=\E[%p1%dP, dch=\E[%p1%dP,
dch1=\E[P, dch1=\E[P,
dim=\E[2m,
dl=\E[%p1%dM, dl=\E[%p1%dM,
dl1=\E[M, dl1=\E[M,
ech=\E[%p1%dX, ech=\E[%p1%dX,
@@ -33,7 +34,7 @@ st-mono| simpleterm monocolor,
el=\E[K, el=\E[K,
el1=\E[1K, el1=\E[1K,
enacs=\E)0, enacs=\E)0,
flash=\E[?5h$<80/>\E[?5l, flash=\E[?5h\E[?5l,
fsl=^G, fsl=^G,
home=\E[H, home=\E[H,
hpa=\E[%i%p1%dG, hpa=\E[%i%p1%dG,
@@ -46,37 +47,23 @@ st-mono| simpleterm monocolor,
ind=^J, ind=^J,
indn=\E[%p1%dS, indn=\E[%p1%dS,
invis=\E[8m, invis=\E[8m,
is2=\E[4l\E>\E[?1034l, is2=\E[4l\E>,
it#8, it#8,
kel=\E[1;2F,
ked=\E[1;5F,
ka1=\E[1~,
ka3=\E[5~,
kc1=\E[4~,
kc3=\E[6~,
kbs=\177, kbs=\177,
kcbt=\E[Z, kcub1=\E[D,
kb2=\EOu, kcud1=\E[B,
kcub1=\EOD, kcuf1=\E[C,
kcud1=\EOB, kcuu1=\E[A,
kcuf1=\EOC, kLFT=\E[d,
kcuu1=\EOA, kRIT=\E[c,
kDC=\E[3;2~, kind=\E[a,
kent=\EOM, kri=\E[b,
kEND=\E[1;2F,
kIC=\E[2;2~,
kNXT=\E[6;2~,
kPRV=\E[5;2~,
kHOM=\E[1;2H,
kLFT=\E[1;2D,
kRIT=\E[1;2C,
kind=\E[1;2B,
kri=\E[1;2A,
kclr=\E[3;5~,
kdl1=\E[3;2~,
kdch1=\E[3~, kdch1=\E[3~,
kich1=\E[2~, kich1=\E[2~,
kend=\E[4~, kend=\E[4~,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf1=\EOP, kf1=\EOP,
kf2=\EOQ, kf2=\EOQ,
kf3=\EOR, kf3=\EOR,
@@ -86,151 +73,51 @@ st-mono| simpleterm monocolor,
kf7=\E[18~, kf7=\E[18~,
kf8=\E[19~, kf8=\E[19~,
kf9=\E[20~, kf9=\E[20~,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[1;2P,
kf14=\E[1;2Q,
kf15=\E[1;2R,
kf16=\E[1;2S,
kf17=\E[15;2~,
kf18=\E[17;2~,
kf19=\E[18;2~,
kf20=\E[19;2~,
kf21=\E[20;2~,
kf22=\E[21;2~,
kf23=\E[23;2~,
kf24=\E[24;2~,
kf25=\E[1;5P,
kf26=\E[1;5Q,
kf27=\E[1;5R,
kf28=\E[1;5S,
kf29=\E[15;5~,
kf30=\E[17;5~,
kf31=\E[18;5~,
kf32=\E[19;5~,
kf33=\E[20;5~,
kf34=\E[21;5~,
kf35=\E[23;5~,
kf36=\E[24;5~,
kf37=\E[1;6P,
kf38=\E[1;6Q,
kf39=\E[1;6R,
kf40=\E[1;6S,
kf41=\E[15;6~,
kf42=\E[17;6~,
kf43=\E[18;6~,
kf44=\E[19;6~,
kf45=\E[20;6~,
kf46=\E[21;6~,
kf47=\E[23;6~,
kf48=\E[24;6~,
kf49=\E[1;3P,
kf50=\E[1;3Q,
kf51=\E[1;3R,
kf52=\E[1;3S,
kf53=\E[15;3~,
kf54=\E[17;3~,
kf55=\E[18;3~,
kf56=\E[19;3~,
kf57=\E[20;3~,
kf58=\E[21;3~,
kf59=\E[23;3~,
kf60=\E[24;3~,
kf61=\E[1;4P,
kf62=\E[1;4Q,
kf63=\E[1;4R,
khome=\E[1~, khome=\E[1~,
kil1=\E[2;5~,
krmir=\E[2;2~,
knp=\E[6~, knp=\E[6~,
kmous=\E[M, kmous=\E[M,
kpp=\E[5~, kpp=\E[5~,
lines#24, lines#24,
mir, mir,
msgr, msgr,
npc, ncv#3,
op=\E[39;49m, op=\E[39;49m,
pairs#64, pairs#64,
mc0=\E[i,
mc4=\E[4i,
mc5=\E[5i,
rc=\E8, rc=\E8,
rev=\E[7m, rev=\E[7m,
ri=\EM, ri=\EM,
ritm=\E[23m, ritm=\E[23m,
rmacs=\E(B, rmacs=\E(B,
rmcup=\E[?1049l, rmcup=\E[?1049l,
rmir=\E[4l, # rmkx=\E>,
rmkx=\E[?1l\E>, rmso=\E[23m,
rmso=\E[27m, rmul=\E[m,
rmul=\E[24m,
rs1=\Ec, rs1=\Ec,
rs2=\E[4l\E>\E[?1034l, rs2=\E[4l\E>,
sc=\E7, sc=\E7,
sitm=\E[3m,
sgr0=\E[0m,
smacs=\E(0,
smcup=\E[?1049h,
smir=\E[4h,
smkx=\E[?1h\E=,
smso=\E[7m,
smul=\E[4m,
tbc=\E[3g,
tsl=\E]0;,
xenl,
vpa=\E[%i%p1%dd,
# XTerm extensions
rmxx=\E[29m,
smxx=\E[9m,
# 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, setab=\E[4%p1%dm,
setaf=\E[3%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, 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, 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, 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,
smacs=\E(0,
smcup=\E[?1049h,
# smkx=\E=,
smso=\E[3m,
smul=\E[4m,
tbc=\E[3g,
tsl=\E]0;,
ul,
xenl,
vpa=\E[%i%p1%dd,
st-256color| simpleterm with 256 colors, st-256color| simpleterm with 256 colors,
use=st, use=st,
ccc,
colors#256, colors#256,
oc=\E]104\007,
pairs#32767, pairs#32767,
# Nicked from xterm-256color # 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, 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, setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
st-meta| simpleterm with meta key,
use=st,
km,
rmm=\E[?1034l,
smm=\E[?1034h,
rs2=\E[4l\E>\E[?1034h,
is2=\E[4l\E>\E[?1034h,
st-meta-256color| simpleterm with meta key and 256 colors,
use=st-256color,
km,
rmm=\E[?1034l,
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,
-39
View File
@@ -1,39 +0,0 @@
/* 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 xsettitle(char *);
int xsetcursor(int);
void xsetmode(int, unsigned int);
void xsetpointermotion(int);
void xsetsel(char *);
int xstartdraw(void);
void xximspot(int, int);
-2055
View File
File diff suppressed because it is too large. Load diff