efe3937183
Enabling enacs and adding compatibility to xterm and urxvt for alternative charsets.
Christoph Lohmann2012-09-25 21:17:43 +02:00
980c5956ed
Enabling enacs and adding compatibility to xterm and urxvt for alternative
Christoph Lohmann2012-09-25 21:17:43 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-25 21:04:35 +02:00
33eaeacaa4
Changing the default font to DejaVu Sans Mono, which is more appealing and activating antialiasing.
Christoph Lohmann2012-09-24 14:01:59 +02:00
246d704ba0
Changing the default font to DejaVu Sans Mono, which is more appealing and
Christoph Lohmann2012-09-24 14:01:59 +02:00
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.
Christoph Lohmann2012-09-24 11:04:26 +02:00
055a4f6d2c
The xinit() call needs to be behind all the tty init, otherwise all the
Christoph Lohmann2012-09-24 11:04:26 +02:00
656c43b4c7
Add some documentetion to tsetmode The names of the terminal modes supported by vt102 are (taken from the VT220 programmer reference manual):
Roberto E. Vargas Caballero2012-09-24 10:29:37 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-24 10:28:35 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-24 10:28:05 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-24 10:26:50 +02:00
8b0167b596
Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too.
Christoph Lohmann2012-09-17 22:44:27 +02:00
e4bf2679c1
Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too.
Christoph Lohmann2012-09-17 22:44:27 +02:00
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(+)
Roberto E. Vargas Caballero2012-09-17 22:13:17 +02:00
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:
Roberto E. Vargas Caballero2012-09-17 22:13:09 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-17 22:11:20 +02:00
8a9c8b7502
Applying a shortening proposal for the run loop of k0ga.
Christoph Lohmann2012-09-16 20:43:51 +02:00
426887ccec
Applying a shortening proposal for the run loop of k0ga.
Christoph Lohmann2012-09-16 20:43:51 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-16 14:02:35 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-16 10:49:12 +02:00
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:
Roberto E. Vargas Caballero2012-09-16 10:48:38 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-16 10:47:21 +02:00
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(+)
Roberto E. Vargas Caballero2012-09-16 10:46:08 +02:00
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):
Roberto E. Vargas Caballero2012-09-16 10:45:36 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-12 21:51:55 +02:00
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(-)
Roberto E. Vargas Caballero2012-09-12 21:25:35 +02:00
fd7f78f2c7
Removing masks for unhandled enter and leaving events.
Christoph Lohmann2012-09-05 22:39:09 +02:00
4a4ae19158
Removing masks for unhandled enter and leaving events.
Christoph Lohmann2012-09-05 22:39:09 +02:00
001b0152a4
If the selection is cleared, draw() and do it on button press too.
Christoph Lohmann2012-09-05 22:17:42 +02:00
dd0b7a077f
If the selection is cleared, draw() and do it on button press too.
Christoph Lohmann2012-09-05 22:17:42 +02:00
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.
Roberto E. Vargas Caballero2012-09-05 21:55:45 +02:00