Roberto E. Vargas Caballero [Tue, 13 Nov 2012 19:04:45 +0000 (20:04 +0100)]
Remove hardcoded keys form kpress
Some keys were in the Key array while others were hardcoded in
kpress().This cause some problems with some keys which can generate more of
one string based in the configuration of the terminal.
---
config.def.h | 70 ++++++++++++++++++++++++++++++++++++++++-----------------
st.c | 71 +++++++++++++++++++++++++---------------------------------
2 files changed, 79 insertions(+), 62 deletions(-)
Roberto E. Vargas Caballero [Tue, 13 Nov 2012 19:04:39 +0000 (20:04 +0100)]
Move Shift + Insert to shortcut
Shift + Insert is used like a hot key for paste the selection, so it is more
logical move it to shortcut array instead of having special code for it.
---
config.def.h | 1 +
st.c | 13 +++----------
2 files changed, 4 insertions(+), 10 deletions(-)
Roberto E. Vargas Caballero [Tue, 13 Nov 2012 19:04:34 +0000 (20:04 +0100)]
Fix keypad mode and cursor mode
Keypad mode is used for detecting when keys in the auxiliary keypad are
pressed, while cursor mode is used for detecting when a cursor is pressed,
but they are different modes.
St was mixing both modes and DECPAM and DECPNM modified the cursor mode, and
this was incorrect.
---
st.c | 5 +++--
st.info | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
Roberto E. Vargas Caballero [Tue, 13 Nov 2012 19:04:26 +0000 (20:04 +0100)]
Add SRM sequence
This sequence enable/disable the local echo.
---
st.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++------------------
1 file changed, 56 insertions(+), 20 deletions(-)
Christoph Lohmann [Sun, 11 Nov 2012 18:46:34 +0000 (19:46 +0100)]
Gc is not used anymore.
Christoph Lohmann [Sun, 11 Nov 2012 18:38:41 +0000 (19:38 +0100)]
Removing some xft naming cruft.
Christoph Lohmann [Thu, 8 Nov 2012 16:22:48 +0000 (17:22 +0100)]
Moving the alt declaration to the beginning of the function.
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:22:04 +0000 (17:22 +0100)]
Move unsupported sequences to ignored.
These sequences will be never implemented and in this moment they are
generating a lot of noise.
---
st.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:21:41 +0000 (17:21 +0100)]
Ignore DECARM sequence
DECARM modify the auto repeat settings in the keyboard, and since we can not
modify this setting in the Xserver the best solution is only ignore it.
---
st.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:21:24 +0000 (17:21 +0100)]
Fix VPR sequence
VPR stands for Move cursor down a number of rows, and the code was moving
the cursor up instead of moving it down.
---
st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:21:10 +0000 (17:21 +0100)]
Add DECOM sequence
DECOM sequence allows to the user defines a new home position. The home
position is used as base for all the movement commands except HVP and
VPA. It is important notice than DECSLM moves cursor to absolute position
0,0.
---
st.c | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:20:15 +0000 (17:20 +0100)]
Save cursor position in terminal reset
After terminal reset saved terminal position is reset to 0, allowing know
where cursor will go in next restore cursor operation.
---
st.c | 2 ++
1 file changed, 2 insertions(+)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:17:26 +0000 (17:17 +0100)]
Clarify some or exclusive expressions
Since relational expresions are always evaluated to 0 or 1, we can use
bitwise xor operator instead of using more complex boolean expressions.
---
st.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Roberto E. Vargas Caballero [Thu, 8 Nov 2012 16:15:26 +0000 (17:15 +0100)]
Fix bug restoring cursor position
Sequences like DECSC, DECRC, ESC [?1047l or ESC [?1047h save and restore
cursor attributes, than taken from vt100 manual are:
Save Cursor (DECSC) ESC 7
===========================
Saves the following in terminal memory.
- cursor position
- graphic rendition
- character set shift state
- state of wrap flag
- state of origin mode
Restore Cursor (DECRC) ESC 8
===========================
Restores the states described for (DECSC) above. If none of these
characteristics were saved, the cursor moves to home position; origin
mode is reset; no character attributes are assigned; and the default
character set mapping is established.
This implies that hide attribute of the cursor should not be saved/restored
in these sequences. The best way to fix this problem is moving hide
attribute into the terminal mode, instead of having it in the cursor state.
---
st.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Christoph Lohmann [Tue, 6 Nov 2012 22:44:37 +0000 (23:44 +0100)]
Adding scrollwheel support. Thanks Brandon Invergo!
Christoph Lohmann [Mon, 5 Nov 2012 03:02:20 +0000 (04:02 +0100)]
Changing the license to MIT/X.
Christoph Lohmann [Sat, 3 Nov 2012 23:04:56 +0000 (00:04 +0100)]
Fixing meta+return. Thanks Szabolcs Nagy!
Christoph Lohmann [Sat, 3 Nov 2012 13:05:45 +0000 (14:05 +0100)]
Removing the debugging for the last fix too.
Christoph Lohmann [Sat, 3 Nov 2012 13:05:15 +0000 (14:05 +0100)]
Fixing a resize bug, if a smaller amount than the lineheight is resized.
Thanks c00kiemon5ter!
Christoph Lohmann [Sat, 3 Nov 2012 12:43:20 +0000 (13:43 +0100)]
Fixing bold fonts in reverse mode.
Christoph Lohmann [Sat, 3 Nov 2012 07:35:32 +0000 (08:35 +0100)]
Now italic and bold works.
Christoph Lohmann [Sat, 3 Nov 2012 02:24:22 +0000 (03:24 +0100)]
Fixing an out-of-bound bug in the selection code. Thanks Szabolczs Nagy!
Christoph Lohmann [Fri, 2 Nov 2012 22:19:56 +0000 (23:19 +0100)]
Fixing the italic-bold font check. Thanks nsz.
Christoph Lohmann [Fri, 2 Nov 2012 19:08:51 +0000 (20:08 +0100)]
Added tag 0.3 for changeset
9d54ce4daf34
Christoph Lohmann [Fri, 2 Nov 2012 19:08:27 +0000 (20:08 +0100)]
0.3 release.
Christoph Lohmann [Fri, 2 Nov 2012 19:07:11 +0000 (20:07 +0100)]
Make it possible to use the corefont font description too. It is not very
useful, but easy to implement.
Christoph Lohmann [Fri, 2 Nov 2012 18:56:02 +0000 (19:56 +0100)]
Moving to the dwm config.h variable usage.
Christoph Lohmann [Wed, 31 Oct 2012 19:36:32 +0000 (20:36 +0100)]
Adding a FAQ to reference utmp(1).
Christoph Lohmann [Wed, 31 Oct 2012 19:35:07 +0000 (20:35 +0100)]
Cleaning up the TODO file.
Christoph Lohmann [Sun, 28 Oct 2012 13:13:39 +0000 (14:13 +0100)]
Removing the now senseless comment in config.def.h. Thanks to bnwe!
Christoph Lohmann [Sun, 28 Oct 2012 12:37:11 +0000 (13:37 +0100)]
Applying the patch of the little girl <yui@blekksprut.net> to make cjk input
possible. Thanks!
Christoph Lohmann [Sun, 28 Oct 2012 12:35:00 +0000 (13:35 +0100)]
Applying the tab expansion patch from koga.
Christoph Lohmann [Sun, 28 Oct 2012 12:25:53 +0000 (13:25 +0100)]
Adding a more flexible fontstring handling, shortcuts and a zoom function.
Christoph Lohmann [Sun, 28 Oct 2012 05:54:08 +0000 (06:54 +0100)]
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.
Christoph Lohmann [Sun, 28 Oct 2012 05:32:54 +0000 (06:32 +0100)]
Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego@gmail.com> to
not emulate the vt100 behaviour of selecting all whitespaces. Thanks!
Roberto E. Vargas Caballero [Sun, 28 Oct 2012 05:27:42 +0000 (06:27 +0100)]
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(-)
Christoph Lohmann [Tue, 9 Oct 2012 17:40:37 +0000 (19:40 +0200)]
Well, I was confused. Damn state exams. Instead of discussing this shit I
should really learn opthalmology instead. :O
Christoph Lohmann [Tue, 9 Oct 2012 17:33:26 +0000 (19:33 +0200)]
If there is really someone without SHELL set, help him/her.
Roberto E. Vargas Caballero [Sun, 7 Oct 2012 09:06:17 +0000 (11:06 +0200)]
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(-)
Roberto E. Vargas Caballero [Sun, 7 Oct 2012 09:06:08 +0000 (11:06 +0200)]
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(-)
Roberto E. Vargas Caballero [Sun, 7 Oct 2012 09:06:00 +0000 (11:06 +0200)]
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(-)
Roberto E. Vargas Caballero [Sat, 6 Oct 2012 19:19:56 +0000 (21:19 +0200)]
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(+)
Christoph Lohmann [Sat, 6 Oct 2012 19:02:25 +0000 (21:02 +0200)]
Fixing a typo.
Christoph Lohmann [Sat, 6 Oct 2012 18:52:22 +0000 (20:52 +0200)]
Fixing a off-by-one error in the new border clearing code.
Roberto E. Vargas Caballero [Sat, 6 Oct 2012 17:15:30 +0000 (19:15 +0200)]
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(-)
Roberto E. Vargas Caballero [Sat, 6 Oct 2012 17:13:36 +0000 (19:13 +0200)]
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(-)
Roberto E. Vargas Caballero [Sat, 6 Oct 2012 17:13:08 +0000 (19:13 +0200)]
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(-)
Roberto E. Vargas Caballero [Sat, 6 Oct 2012 17:12:46 +0000 (19:12 +0200)]
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(-)
Christoph Lohmann [Sat, 6 Oct 2012 11:45:14 +0000 (13:45 +0200)]
Forgot to remove the xclearborders() definition from the last commit.
Christoph Lohmann [Sat, 6 Oct 2012 11:43:01 +0000 (13:43 +0200)]
Removing the xclearborders() hack. St now cleans up the parts of the border,
if something needs to be drawn close to it.
Christoph Lohmann [Sat, 6 Oct 2012 07:58:45 +0000 (09:58 +0200)]
The style inquisition was here. Yes, making it a unified style. The last
infidels will be squashed too!
Christoph Lohmann [Fri, 5 Oct 2012 20:59:08 +0000 (22:59 +0200)]
Adding the patch of David Dufberg Töttrup to implement WM_DELETE_WINDOW. Thank you!
Christoph Lohmann [Fri, 5 Oct 2012 20:51:08 +0000 (22:51 +0200)]
Fixing the brightening on bold. For the 256 colors and greyscale I assumed a
reasonable solution.
Christoph Lohmann [Fri, 5 Oct 2012 09:07:55 +0000 (11:07 +0200)]
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.
Christoph Lohmann [Fri, 5 Oct 2012 07:38:10 +0000 (09:38 +0200)]
When the drawing behaviour was changed underline was not corrected.
Thanks to Peter A. Shevtsov!
Christoph Lohmann [Thu, 4 Oct 2012 20:59:45 +0000 (22:59 +0200)]
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.
Christoph Lohmann [Tue, 2 Oct 2012 10:48:55 +0000 (12:48 +0200)]
Thanks to c00kiemon5ter. Not changing bold to bright colors seems to be the
right choice.
Christoph Lohmann [Sun, 30 Sep 2012 18:23:45 +0000 (20:23 +0200)]
Removing the now obsolete definitions from the config.def.h file.
Christoph Lohmann [Sun, 30 Sep 2012 18:23:10 +0000 (20:23 +0200)]
This changes -f to be the parameter for the font. Now -f is -o.
The parameters were reordered according to the alphabet too.
Christoph Lohmann [Sun, 30 Sep 2012 18:10:58 +0000 (20:10 +0200)]
Remove the cruft of the user to have to define the different font styles.
Christoph Lohmann [Sat, 29 Sep 2012 09:23:34 +0000 (11:23 +0200)]
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.
Christoph Lohmann [Sat, 29 Sep 2012 09:17:16 +0000 (11:17 +0200)]
All xcolors are not Xft colors and the clearing of the borders has been
optimized. There is a speedup when resizing windows.
Christoph Lohmann [Thu, 27 Sep 2012 17:28:44 +0000 (19:28 +0200)]
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.
Roberto E. Vargas Caballero [Wed, 26 Sep 2012 18:55:18 +0000 (20:55 +0200)]
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(-)
Roberto E. Vargas Caballero [Wed, 26 Sep 2012 18:53:46 +0000 (20:53 +0200)]
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(-)
Christoph Lohmann [Wed, 26 Sep 2012 18:21:59 +0000 (20:21 +0200)]
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.
Christoph Lohmann [Wed, 26 Sep 2012 18:21:08 +0000 (20:21 +0200)]
Implementing line drawing right.
Christoph Lohmann [Tue, 25 Sep 2012 19:39:25 +0000 (21:39 +0200)]
A reset should reset the line drawing too.
Christoph Lohmann [Tue, 25 Sep 2012 19:17:43 +0000 (21:17 +0200)]
Enabling enacs and adding compatibility to xterm and urxvt for alternative
charsets.
Roberto E. Vargas Caballero [Tue, 25 Sep 2012 19:04:35 +0000 (21:04 +0200)]
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(-)
Christoph Lohmann [Mon, 24 Sep 2012 12:01:59 +0000 (14:01 +0200)]
Changing the default font to DejaVu Sans Mono, which is more appealing and
activating antialiasing.
Christoph Lohmann [Mon, 24 Sep 2012 09:04:26 +0000 (11:04 +0200)]
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 Lohmann [Mon, 24 Sep 2012 08:31:35 +0000 (10:31 +0200)]
Adding a TODO for xft fallback.
Roberto E. Vargas Caballero [Mon, 24 Sep 2012 08:29:37 +0000 (10:29 +0200)]
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(-)
Roberto E. Vargas Caballero [Mon, 24 Sep 2012 08:28:35 +0000 (10:28 +0200)]
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 Caballero [Mon, 24 Sep 2012 08:28:05 +0000 (10:28 +0200)]
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 Caballero [Mon, 24 Sep 2012 08:27:22 +0000 (10:27 +0200)]
Remove unused parameters in ttyresize
---
st.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Roberto E. Vargas Caballero [Mon, 24 Sep 2012 08:26:50 +0000 (10:26 +0200)]
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(-)
Christoph Lohmann [Mon, 24 Sep 2012 08:24:36 +0000 (10:24 +0200)]
Merging xft and current st heads.
Christoph Lohmann [Mon, 24 Sep 2012 08:20:45 +0000 (10:20 +0200)]
Initial Xft support for st. More to follow.
Aurélien Aptel [Wed, 19 Sep 2012 14:03:16 +0000 (16:03 +0200)]
use typedef'd unsigned type and regular bool type.
Aurélien Aptel [Tue, 18 Sep 2012 17:13:19 +0000 (19:13 +0200)]
config.def.h: typo in comment.
Aurélien Aptel [Tue, 18 Sep 2012 17:08:03 +0000 (19:08 +0200)]
LEGACY: typo.
Christoph Lohmann [Mon, 17 Sep 2012 21:14:40 +0000 (23:14 +0200)]
Redrawing is fixed.
Christoph Lohmann [Mon, 17 Sep 2012 20:44:27 +0000 (22:44 +0200)]
Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too.
Roberto E. Vargas Caballero [Mon, 17 Sep 2012 20:13:17 +0000 (22:13 +0200)]
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 Caballero [Mon, 17 Sep 2012 20:13:09 +0000 (22:13 +0200)]
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(-)
Roberto E. Vargas Caballero [Mon, 17 Sep 2012 20:11:28 +0000 (22:11 +0200)]
Add newline in error messages
---
st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Roberto E. Vargas Caballero [Mon, 17 Sep 2012 20:11:20 +0000 (22:11 +0200)]
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(-)
Christoph Lohmann [Sun, 16 Sep 2012 18:43:51 +0000 (20:43 +0200)]
Applying a shortening proposal for the run loop of k0ga.
Roberto E. Vargas Caballero [Sun, 16 Sep 2012 12:02:35 +0000 (14:02 +0200)]
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(-)
Christoph Lohmann [Sun, 16 Sep 2012 11:59:10 +0000 (13:59 +0200)]
Adding some more fields to the manpage, like authors, license etc.
Christoph Lohmann [Sun, 16 Sep 2012 11:50:07 +0000 (13:50 +0200)]
Remove some solved issues and add some new.
Christoph Lohmann [Sun, 16 Sep 2012 11:22:23 +0000 (13:22 +0200)]
Preliminary solution to the stuttering problem.
Roberto E. Vargas Caballero [Sun, 16 Sep 2012 08:49:12 +0000 (10:49 +0200)]
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 Caballero [Sun, 16 Sep 2012 08:48:38 +0000 (10:48 +0200)]
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(-)
Roberto E. Vargas Caballero [Sun, 16 Sep 2012 08:47:21 +0000 (10:47 +0200)]
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 Caballero [Sun, 16 Sep 2012 08:46:08 +0000 (10:46 +0200)]
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 Caballero [Sun, 16 Sep 2012 08:45:36 +0000 (10:45 +0200)]
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(-)
Christoph Lohmann [Fri, 14 Sep 2012 17:46:07 +0000 (19:46 +0200)]
Implementing italic-bold. This will require an increase of the avgWdth.