OpenBSD CVS

CVS log for src/usr.bin/mg/ttyio.c


[BACK] Up to [local] / src / usr.bin / mg

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.40 / (download) - annotate - [select for diffs], Sat Mar 20 09:00:49 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Add a 'batch' mode to mg via the '-b' command line option which will
initialise a pty, run the specified file of mg commands and then exit.

This is to facilitate mg fitting into the OpenBSD regress test
framework and be able to run via a cron job.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Mar 1 10:51:14 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Put the hardcoded '\n' character which is found throughout mg into a
buffer specific variable. The diff should not produce any behavourial
changes in mg.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:02 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.37: +5 -5 lines
Diff to previous 1.37 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Mar 23 12:31:19 2015 UTC (9 years, 1 month ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.36: +1 -14 lines
Diff to previous 1.36 (colored)

DIFFTOOL has to be defined for mg to build. TCSASOFT is defined via
termios.h so we don't need the code for when it is not defined.
ok reyk@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Mar 19 21:22:15 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.35: +13 -5 lines
Diff to previous 1.35 (colored)

Clean up the includes in mg.
This does the following:
Moves all POSIX headers from sysdef.h into the individual .c files so that
each file now only includes what it needs. All headers are properly sorted.
Moves the remainder of sysdef.h to other files (mostly def.h) and deletes
sysdef.h now that it's no longer contains anything.
Tweak a comment that references sysdef.h so that it no longer does that.
ok florian@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 20 07:47:29 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

Add some missing dobeeps.
ok florian@

Revision 1.34 / (download) - annotate - [select for diffs], Sat Apr 20 17:39:50 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.33: +6 -9 lines
Diff to previous 1.33 (colored)

use poll() instead of select() [with a fixed size fd_set]
ok florian

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jan 19 21:22:28 2013 UTC (11 years, 4 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.32: +10 -2 lines
Diff to previous 1.32 (colored)

Don't spin in ttgetc when stdin is lost (found by benno@).
While there prevent an unterminated recursion in panic().
ok lum@, benno@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Feb 5 12:53:38 2008 UTC (16 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.31: +5 -2 lines
Diff to previous 1.31 (colored)

prevent the "ttflush write failed" panic when resizing using a window
manager that that continously sends resize events.

fix inspired by an older diff for vi (r1.15 of src/usr.bin/vi/cl/cl_screen.c)

ok otto@ jasper@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Apr 3 05:03:34 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

few more int that can become a size_t

Revision 1.30 / (download) - annotate - [select for diffs], Mon Apr 3 00:40:56 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

lint love; ok kjell

Revision 1.29 / (download) - annotate - [select for diffs], Tue Dec 13 06:01:27 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

More name-clash delinting

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jun 14 18:14:40 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

Add explicit public domain notices to all public domain files.
ok millert@, deraadt@

Revision 1.27 / (download) - annotate - [select for diffs], Wed Apr 13 02:33:08 2005 UTC (19 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

use STD{IN,OUT,ERR}_FILENO

Revision 1.26 / (download) - annotate - [select for diffs], Sun Apr 3 02:09:28 2005 UTC (19 years, 1 month ago) by db
Branch: MAIN
Changes since 1.25: +12 -12 lines
Diff to previous 1.25 (colored)

This is a no binary change which does:

- spelling, punctuation fixes
- variable declaration lineup
- use parentheses for return and sizeof
- K&R function declarations -> ANSI
- other minor code beautification

ok henning@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Dec 4 01:37:28 2003 UTC (20 years, 5 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

fix sign extension bug that broke meta key support

from sra@hactrn.net

Revision 1.24 / (download) - annotate - [select for diffs], Sun Nov 9 00:23:01 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
Changes since 1.23: +10 -5 lines
Diff to previous 1.23 (colored)

fix up terminal correctly on panic (keeps terminal state correct when
started with an invalid $TERM)

spotted by deraadt

Revision 1.23 / (download) - annotate - [select for diffs], Sun Sep 15 14:08:57 2002 UTC (21 years, 8 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.22: +26 -32 lines
Diff to previous 1.22 (colored)

KNF

Revision 1.22 / (download) - annotate - [select for diffs], Thu Aug 22 23:28:19 2002 UTC (21 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

knf

Revision 1.21 / (download) - annotate - [select for diffs], Thu Mar 28 17:50:36 2002 UTC (22 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

Fix bug I introduced in previous commit.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Mar 27 20:47:14 2002 UTC (22 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.19: +5 -5 lines
Diff to previous 1.19 (colored)

Fix write() loop in ttflush().  Pointed out by vincent@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Mar 27 17:42:37 2002 UTC (22 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.18: +12 -8 lines
Diff to previous 1.18 (colored)

Fixes the the following problems (from zyrnix)
1) Mg crashes with column width of 1, rows > 2
2) Mg panics on resizing due to incomplete write
3) Mg doesn't compile with STARTUPFILE defined
deraadt@ OK

Revision 1.18 / (download) - annotate - [select for diffs], Thu Feb 21 00:02:05 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +12 -3 lines
Diff to previous 1.17 (colored)

signal-safe window size changing

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jan 10 12:13:35 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.16: +1 -29 lines
Diff to previous 1.16 (colored)

Clean up tty resizing code.
Catch SIGWINCH and resize and refresh the screen.

Revision 1.16 / (download) - annotate - [select for diffs], Thu May 24 03:05:27 2001 UTC (23 years ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

spaces

Revision 1.15 / (download) - annotate - [select for diffs], Wed May 23 22:20:36 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

remove VOID. We're way beyond the point where this could build with an
ancient compiler.

Revision 1.14 / (download) - annotate - [select for diffs], Thu May 3 20:40:22 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.13: +6 -8 lines
Diff to previous 1.13 (colored)

Add a delay (in miliseconds) argument to ttwait.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jan 29 01:58:10 2001 UTC (23 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.12: +2 -0 lines
Diff to previous 1.12 (colored)

$OpenBSD$

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jul 25 19:52:50 2000 UTC (23 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.11: +4 -1 lines
Diff to previous 1.11 (colored)

o check that we are on a tty (and bail if not)
o in panic() just call exit() not abort()

Revision 1.11 / (download) - annotate - [select for diffs], Thu Apr 13 06:12:18 2000 UTC (24 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.10: +3 -15 lines
Diff to previous 1.10 (colored)

The start of KNF + -Wall.  The code has been run through indent but
needs hand fixup.  I stopped at keymap.c...

Revision 1.10 / (download) - annotate - [select for diffs], Thu Mar 2 21:55:41 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

add missing return value

Revision 1.9 / (download) - annotate - [select for diffs], Thu Mar 2 17:01:41 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Use a char, not a char[1] in ttgetc and cast the return value to int.
Perhaps this should really be a u_char but I don't think it really matters.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 2 15:51:36 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.7: +133 -100 lines
Diff to previous 1.7 (colored)

Reorganize to be more like the BSD version + KNF

Revision 1.7 / (download) - annotate - [select for diffs], Sun Feb 27 17:30:40 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.6: +14 -0 lines
Diff to previous 1.6 (colored)

make this compile on systems w/o TCSASOFT

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 27 17:24:12 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.5: +7 -8 lines
Diff to previous 1.5 (colored)

Better setting of terminal 'raw' mode, cribbed from BSD curses.
We no longer try to put the terminal into 8bit, no parity mode and
instead use the TCSASOFT flag to tcsetattr() as per the discussion
of this in lib/libocurses/tty.c.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 27 05:52:32 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.4: +35 -68 lines
Diff to previous 1.4 (colored)

Call setttysize() from ttinit() not ttopen() since we haven't
run setupterm() until ttinit() is called.
Remove a tgetnum() I missed in the termcap -> terminfo cleanup.
Merge parts of the BSD ttyio.c.  The termios stuff here could use a
cleanup, possibly including the flow control hack from the BSD ttyio.c.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Feb 26 22:53:16 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.3: +10 -43 lines
Diff to previous 1.3 (colored)

change WINDOW -> MGWIN to avoid curses type conflict
convert to terminfo in tty*.c
add support for some keypad function keys (arrows, pgup, pgdown)

Revision 1.3 / (download) - annotate - [select for diffs], Fri Feb 25 19:13:21 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +0 -1 lines
Diff to previous 1.2 (colored)

further pruning

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 25 19:09:48 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +7 -8 lines
Diff to previous 1.1 (colored)

make it minimally compile; millert

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 25 19:08:52 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN

initial import of mg2a

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.