Commit Briefs

e8f1308586 Roberto E. Vargas Caballero

Receive only a wchar_t in tchar() (wchar)

It makes simpler the conversion from utf8 input string and makes simpler the checks done in tputc, but it still requires a lot of additional conversions that will be removed later.


d65ebe9aed Roberto E. Vargas Caballero

First step to plain unicode representation

tprinter() is used in tputc, so a first step is to change it to accept a wchar_t instead of a multibyte string. This patch makes more ugly the code because it needs a lot of conversions, but they will be removed later.


28f56c8842 Roberto E. Vargas Caballero

Remove last parameter of utf8encode

This parameter was always UTF_SIZ, so it is better remove it and use directly UTF_SIZ in in.


23af75fc75 Roberto E. Vargas Caballero

Simplify utf8decodebyte using some locals

These local variables help to make expressions simpler and avoid use a pointer as induction variable in a for loop.


c7a945c408 Roberto E. Vargas Caballero

Add missed names of charset sequences


5afb3862ba Roberto E. Vargas Caballero

Add support for utmp in st

St runs an interactive shell and not a login shell, and it means that profile is not loaded. The default terminal configuration in some system is not the correct for st, but since profile is not loaded there is no way of getting a script configures the correct values. St doesn't update the utmp files, this is the job of another suckless tool, utmp. Utmp also opens a login shell (it is the logical behaviour when you create a new user record) it is a good option execute utmp and then get a correct input in utmp, wtmp and lastlog file, and execute the content of the profile.


0392d165d0 Roberto E. Vargas Caballero

Remove indentation level in xdrawcursor


98a1085d0e Roberto E. Vargas Caballero

Removing wrapping newlines from selection

When getting selected text, lines that were wrapped because of length ought not include the wrapping newline in the selection. This comes up, for example, when copying a bash command that is long enough to wrap from the console and pasting it back into the console. The extra newline breaks it. Similiarly, changes behavior when trimming whitespace from the end of a physical line to only do so if the line does not wrap. Otherwise we are trimming whitespace from the middle of a logical line, which may change its meaning. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


51466e019a Roberto E. Vargas Caballero

Change the behavior of word snapping on delimiters

This makes any sequence of identical delimiters be considered a single word in word-snapping mode. This seems more coherent for this mode and is similar to what xterm does. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


c490a60b80 Roberto E. Vargas Caballero

Move calls to selsnap into selnormalize

This simplifies getbuttoninfo() and bpress(), and fixes a bug which made word snapping behave incorrectly when a delimiter was at the beginning or end of line. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


83dea7fd7b Roberto E. Vargas Caballero

Improve readability of enum members

The 'left shift from one' notation of power of two integers is more expressive than the result. Signed-off-by: Alexander Huemer <alexander.huemer@xx.vu> Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


e5f6736ee0 Roberto E. Vargas Caballero

Add eschandle()

We already have a csihandle() function, where is located code about CSI sequences, so it is logical do the same with ESC sequences. This change helps to simplify tcontrol(), which has a complex flow and should be rewritten.


a3549c2eec Roberto E. Vargas Caballero

Improve execsh() and don't allow anonymous shells

This patch improves the shell selection on execsh and forbid shell with users don't registered in the passwd file.


8342036f98 Roberto E. Vargas Caballero

Fix definition of CONTROLC0

DEL character is not thecnically talking a C0 control character, although it has some common properties with them, so it is useful for us consider it as C0. Before this patch DEL (\177), was not ignored as it ought to be.


9d9e049eac Roberto E. Vargas Caballero

Make useful DEL in application mode

DEL key has to generate the sequence ^[P in application mode, because such sequence means delete current character. It implies that the character sent in keypad mode must be ^? (DEL character).


177d888dff Roberto E. Vargas Caballero

reset the alt screen in treset

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


fa04911c91 Roberto E. Vargas Caballero

simplify loop in tresize

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


1926305318 Roberto E. Vargas Caballero

Simplify README

The term 'virtual terminal emulator' was broken. There is nothing virtual about it, it's a terminal emulator. Signed-off-by: Alexander Huemer <alexander.huemer@xx.vu> Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


8f3e6a577d Roberto E. Vargas Caballero

Fix man page and usage()

Man page was repeating -f option, the second time instead of -i, and this option was lost in usage() message. This patch also indent the output of usage().


f8b4998b32 Roberto E. Vargas Caballero

Convert VT102ID to a config variable

VT102ID is the sequence that the terminal returns when it is inquired to identify itself. This value should be configurable in the same way that another st parameters.


6530025bca Roberto E. Vargas Caballero

Fix portability problem in techo()

ISCONTROL chechks if a value is between 0 and 0x1f or between 0x80 and 0x9f. Char signess depends of architecture and compiler, so in some environment the second case is always false (and wrong), Techo() calls ISCONTROL with a char variable, whose type cannot be changed because tpuc() expects a pointer to char, so the solution is to insert a cast in the call to ISCONTROL.


d4a17316d3 Roberto E. Vargas Caballero

Don't set dirty all lines because tswapcreen do it

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


20c4f12254 Roberto E. Vargas Caballero

tresize return value is not used

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>


821a6e00a5 Roberto E. Vargas Caballero

Remove ul capability

This capability indicates that underscore '_' overstrike current letter under the cursor. It means that you can generate a underline 'b' using 'b^H_', because it writes a 'b' then backward one characther and then overstrike '_'. St has not such behaviour, so it is an error to have this capability.


8de8ae3923 Roberto E. Vargas Caballero

Unset mode when clearing regions

tclearregion() was clearing regions using spaces and the current attributes of the terminal. It was correct with all the modes excepct underline, because they didn't affect the space character, but in the case of underline it was a problem. A easy way of seeing this problem is writing this in the last line of the terminal: tput smul ; echo first; tput rmul; echo second; echo third Fist was underlined, and second and third were not underlined, but the spaces at the right of second was underlined becuause in the previous scrool underline mode was set.