summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-unix.c
Commit message (Collapse)AuthorAgeFilesLines
* terminal: always use SA_RESTART with sigaction()wm42014-04-301-1/+1
| | | | | | | One problem is that for example stdio functions won't restart syscalls manually, and instead treat EINTR as an error. So passing SA_RESTART is the only sane thing to do, unless you have special requirements, which we don't.
* terminal-unix: reject overlong termcap stringswm42014-04-171-0/+3
| | | | | | | | Our own tables have size for only 8 chars, so these sequences must be rejected. It seems strings of length 8 are still ok, because the code uses memcmp and not strcmp, so still allow these. Based on mplayer-svn commit r37129.
* terminal: don't initialize termcap etc. if stdout is not a terminalwm42014-01-151-2/+6
| | | | | Otherwise, it seems one of the term* libraries will write escape sequences to stdout, for whatever reason.
* input: rework how input sources are addedwm42013-12-211-1/+18
| | | | | | | | | | | | | | Until now, there were two functions to add input sources (stuff like stdin input, slave mode, lirc, joystick). Unify them to a single function (mp_input_add_fd()), and make sure the associated callbacks always have a context parameter. Change the lirc and joystick code such that they take store their state in a context struct (probably worthless), and use the new mp_msg replacements (the point of this refactoring). Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in the terminal handling code.
* terminal: abstract terminal color handlingwm42013-12-201-1/+21
| | | | | | | | Instead of making msg.c an ifdef hell for unix vs. windows code, move the code to separate functions defined in terminal-unix.c/terminal- win.c. Drop the code that selects random colors for --msgmodule prefixes.
* terminal: move SIGTTOU signal handler setup codewm42013-12-191-0/+2
| | | | | | This comes with a real change in behavior: now the signal handler is set only when the terminal input code is active (e.g. not with --no-consolecontrols), but this should be ok.
* Rename getch2....c/h to terminal....c/hwm42013-12-191-0/+578
"getch2" really tells nothing about what the heck this code does. It'd be even worse when moving the rest of terminal handling code there.