aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/syscons/teken
Commit message (Collapse)AuthorAgeFilesLines
* Move libteken out of the syscons directory.Ed Schouten2009-09-0311-2897/+0
| | | | | | | | | | | | | I initially committed libteken to sys/dev/syscons/teken, but now that I'm working on a console driver myself, I noticed this was not a good decision. Move it to sys/teken to make it easier for other drivers to use a terminal emulator. Also list teken.c in sys/conf/files, instead of listing it in all the files.arch files separately. Notes: svn path=/head/; revision=196775
* Small fixes to Unicode handling:Ed Schouten2009-06-161-1/+1
| | | | | | | | - Add more mappings for Greek characters and the Euro sign. - Print UTF-8 characters in the log file as hexadecimal. Notes: svn path=/head/; revision=194293
* Make the demo/stress tools build again, after my changes to param().Ed Schouten2009-06-102-2/+2
| | | | Notes: svn path=/head/; revision=193940
* Restore support for bell pitch/duration.Ed Schouten2009-05-314-2/+15
| | | | | | | | | | | Because we only support a single argument to tf_param, use 16 bits for the pitch and 16 bits for the duration. While there, make the argument unsigned. There isn't a single param call that needs a signed integer. Submitted by: danfe (modified) Notes: svn path=/head/; revision=193184
* Small cleanup to previous commit.Ed Schouten2009-03-201-1/+1
| | | | | | | Just use % 8, instead of & 0x7. This makes it easier to understand. Notes: svn path=/head/; revision=190158
* Just use default behaviour on tabstops when using too many columns.Ed Schouten2009-03-202-5/+6
| | | | | | | | | | | | | | | | It seems I didn't fix this issue before committing teken to the tree. My initial idea was to somehow add an error mechanism to instruct the video driver author to increase T_NUMCOL when using very big terminals. It turns out we have platforms where we have gigantic consoles on systems like the Apple PowerMac G5, which means we crash there right now. Just ignore tabstops placed beyond column 160. Just force tabs to be placed on each 8 columns. Reported by: nwhitehorn Notes: svn path=/head/; revision=190157
* Make a 1:1 mapping between syscons stats and terminal emulators.Ed Schouten2009-03-102-0/+8
| | | | | | | | | | | | | | | | | | | | | | | After I imported libteken into the source tree, I noticed syscons didn't store the cursor position inside the terminal emulator, but inside the virtual terminal stat. This is not very useful, because when you implement more complex forms of line wrapping, you need to keep track of more state than just the cursor position. Because the kernel messages didn't share the same terminal emulator as ttyv0, this caused a lot of strange things, like kernel messages being misplaced and a missing notification to resize the terminal emulator for kernel messages never to be resized when using vidcontrol. This patch just removes kernel_console_ts and adds a special parameter to te_puts to determine whether messages should be printed using regular colors or the ones for kernel messages. Reported by: ache Tested by: nyan, garga (older version) Notes: svn path=/head/; revision=189617
* Properly implement GIO_ATTR and CONS_GETINFO.Ed Schouten2009-02-092-1/+17
| | | | | | | | It seems I didn't implement these two ioctl()'s properly, which meant vidcontrol couldn't properly obtain certain terminal parameters. Notes: svn path=/head/; revision=188391
* Add Unicode rendering to the teken demo application.Ed Schouten2009-01-212-11/+32
| | | | | | | | | | | | Some time ago I tried adding Unicode rendering to the teken demo application, but I didn't get it working. It seems I forgot to call setlocale(). Polish this code and make sure it doesn't get lost. Also a small fix for my previous commit: all Unicode characters in teken_boxdrawing are below 0x10000, so store them as 16-bit values. Notes: svn path=/head/; revision=187562
* Properly implement the VT100 SCS sequences in xterm-mode.Ed Schouten2009-01-206-31/+201
| | | | | | | | | | | | | | | | | | Even though VT100-like devices can display non-ASCII characters, they do not use an 8-bit character set. Special escape sequences allow the VT100 to switch character maps. The special graphics character set stores the box drawing characters, starting at 0x60, ending at 0x7e. This means we now pass the character map tests in vttest, even the save/restore cursor test, combined with character maps. dialog(1) also works a lot better now. This commit also includes some other minor fixes: - Default to 24 lines in teken_demo when using xterm emulation. - Make white foreground and background work in teken_demo. Notes: svn path=/head/; revision=187469
* Don't forget to mark the color translation array as const.Ed Schouten2009-01-181-2/+2
| | | | | | | Spotted by: Christoph Mallon <christoph mallon gmx de> Notes: svn path=/head/; revision=187382
* Fix for my previous commit: color mapping is not 1:1.Ed Schouten2009-01-171-4/+7
| | | | | | | | | | | | | | | Cons25 doesn't seem to use a straight 1:1 mapping to the ANSI colors, but uses the same color numbers as at least used by syscons on i386. I suspect if you change the definitions on a different architecture, things may break? Not sure. Add a small array to convert syscons-style color codes to ANSI equivalents, which are used by libteken internally. I didn't notice this bug, because I only tested my code with black, white and green, all of them shared the same numbers. Notes: svn path=/head/; revision=187374
* Make vidcontrol's color setting work again.Ed Schouten2009-01-172-0/+25
| | | | | | | | | | | | It turns out I forgot to implement two escape sequences that allows the user to change the default foreground and background colors. I thought they were implemented by syscons itself, but vidcontrol just generates some escape sequences, which get interpreted by the terminal emulator. Reported by: mgp (forums) Notes: svn path=/head/; revision=187373
* Allow experimental libteken features to be tested without changing code.Ed Schouten2009-01-174-57/+55
| | | | | | | | | | | | | | | | The teken library already supports UTF-8 handling and xterm emulation, but we have reasons to disable this right now. Because we should make it easy and interesting for people to experiment with these features, allow them to be set in kernel configuration files. Before this commit we had a flag called `TEKEN_CONS25' to enable cons25-style emulation. I'm calling it the opposite now, `TEKEN_XTERM', because we want to enable it in kernel configuration files explicitly. Requested by: kib Notes: svn path=/head/; revision=187367
* Import yet some more small fixes to libteken sources:Ed Schouten2009-01-053-0/+25
| | | | | | | | | | | | | | - Implement NP (ASCII 12, Form Feed). When used with cons25, it should clear the screen and place the cursor at the top of the screen. When used with xterm, it should just simulate a newline. - When we want to use xterm emulation, make teken_demo set TERM to xterm. Spotted by: Paul B. Mahol <onemda@gmail.com> Notes: svn path=/head/; revision=186798
* Fix rendering glitch in cons25 emulation.Ed Schouten2009-01-041-0/+12
| | | | | | | | | | | | | | Because we now have cons25-style linewrapping, we must also use cons25- style reverse linewrapping. This means that a ^H on column 0 will move the cursor one line up. Also fix a small regression: if the user invokes a RIS (Reset to Initial State), we must show the cursor again. Spotted by: Paul B. Mahol <onemda gmail com> Notes: svn path=/head/; revision=186753
* Print control characters, even though they are normally not visible.Ed Schouten2009-01-042-1/+7
| | | | | | | | | | | With cons25, there are printable characters below 0x1B. This is not the case with ASCII, UTF-8, etc. but in this case we just have to. Also don't set LC_CTYPE to UTF-8 when libteken is compiled without UTF-8 in the demo-application. Notes: svn path=/head/; revision=186731
* Resolve some regressions related to tabs and linewrap handling.Ed Schouten2009-01-034-2/+34
| | | | | | | | | | | | | | | | | | | | | | | It turns out I was looking too much at mimicing xterm, that I didn't take the differences of cons25 into account. There are some differences between xterm and cons25 that are important. Create a new #define called TEKEN_CONS25 that can be toggled to switch between cons25 and xterm mode. - Don't forget to redraw the cursor after processing a forward/backward tabulation. - Implement cons25-style (WYSE?) autowrapping. This form of autowrapping isn't that nice. It wraps the cursor when printing something on column 80. xterm wraps when printing the first character that doesn't fit. - In cons25, a \t shouldn't overwrite previous contents, while xterm does. Reported by: Garrett Cooper <yanefbsd gmail com> Notes: svn path=/head/; revision=186729
* Remove an unneeded assertion in libteken.Ed Schouten2009-01-011-1/+0
| | | | | | | | | The cursor is only inside the scrolling region when we are in origin mode. In that case, it should use originreg instead of scrollreg. It is completely valid to place the cursor outside the scrolling region. Notes: svn path=/head/; revision=186687
* Replace syscons terminal renderer by a new renderer that uses libteken.Ed Schouten2009-01-0110-0/+2568
Some time ago I started working on a library called libteken, which is terminal emulator. It does not buffer any screen contents, but only keeps terminal state, such as cursor position, attributes, etc. It should implement all escape sequences that are implemented by the cons25 terminal emulator, but also a fair amount of sequences that are present in VT100 and xterm. A lot of random notes, which could be of interest to users/developers: - Even though I'm leaving the terminal type set to `cons25', users can do experiments with placing `xterm-color' in /etc/ttys. Because we only implement a subset of features of xterm, this may cause artifacts. We should consider extending libteken, because in my opinion xterm is the way to go. Some missing features: - Keypad application mode (DECKPAM) - Character sets (SCS) - libteken is filled with a fair amount of assertions, but unfortunately we cannot go into the debugger anymore if we fail them. I've done development of this library almost entirely in userspace. In sys/dev/syscons/teken there are two applications that can be helpful when debugging the code: - teken_demo: a terminal emulator that can be started from a regular xterm that emulates a terminal using libteken. This application can be very useful to debug any rendering issues. - teken_stress: a stress testing application that emulates random terminal output. libteken has literally survived multiple terabytes of random input. - libteken also includes support for UTF-8, but unfortunately our input layer and font renderer don't support this. If users want to experiment with UTF-8 support, they can enable `TEKEN_UTF8' in teken.h. If you recompile your kernel or the teken_demo application, you can hold some nice experiments. - I've left PC98 the way it is right now. The PC98 platform has a custom syscons renderer, which supports some form of localised input. Maybe we should port PC98 to libteken by the time syscons supports UTF-8? - I've removed the `dumb' terminal emulator. It has been broken for years. It hasn't survived the `struct proc' -> `struct thread' conversion. - To prevent confusion among people that want to hack on libteken: unlike syscons, the state machines that parse the escape sequences are machine generated. This means that if you want to add new escape sequences, you have to add an entry to the `sequences' file. This will cause new entries to be added to `teken_state.h'. - Any rendering artifacts that didn't occur prior to this commit are by accident. They should be reported to me, so I can fix them. Discussed on: current@, hackers@ Discussed with: philip (at 25C3) Notes: svn path=/head/; revision=186681