Commit Briefs
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.
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.
Remove last parameter of utf8encode
This parameter was always UTF_SIZ, so it is better remove it and use directly UTF_SIZ in in.
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.
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.
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>
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>
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>
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>
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.
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.
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.
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).
reset the alt screen in treset
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
simplify loop in tresize
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
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>
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().
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.
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.
Don't set dirty all lines because tswapcreen do it
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
tresize return value is not used
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
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.
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.
