OpenBSD CVS

CVS log for src/usr.bin/mg/tty.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], Wed Mar 8 04:43:11 2023 UTC (14 months, 1 week ago) by guenther
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, HEAD
Changes since 1.39: +1 -3 lines
Diff to previous 1.39 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.39 / (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_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
Changes since 1.38: +9 -2 lines
Diff to previous 1.38 (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.38 / (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.37: +3 -3 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Sun Feb 9 10:13:13 2020 UTC (4 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.36: +6 -1 lines
Diff to previous 1.36 (colored)

Do not define variables in def.h since this will lead to duplicate definitions
in every source file that includes def.h
Found by gcc10 in portable in gentoo and fedora.
Patch from Ulrich Mueller (ulm AT gentoo.org) via Han Boetes, thanks!
Ok tb

Revision 1.36 / (download) - annotate - [select for diffs], Wed Nov 18 18:44:50 2015 UTC (8 years, 6 months ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, 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
Changes since 1.35: +7 -5 lines
Diff to previous 1.35 (colored)

shrink differences between ttinsl/ttdell

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 19 21:48:05 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.34: +1 -3 lines
Diff to previous 1.34 (colored)

More unifdef cleanup:
-UDIRED_XMAPS and -UFUND_XMAPS: you can't build mg the other way.
-DTIOCGWINSZ: you have this if you have term.h
Remove a #define TERMCAP which isn't being used.

Remove defines for NDIRED_XMAPS, NFUND_XMAPS, and IMAPEXT. They are all
defined to be 0 and are only ever used in addition. We don't need to add 0.
Simply lines that were using those defines.
ok florian@

Revision 1.34 / (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.33: +7 -5 lines
Diff to previous 1.33 (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.33 / (download) - annotate - [select for diffs], Tue Mar 17 18:08:52 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.32: +1 -3 lines
Diff to previous 1.32 (colored)

It is impossible to build mg without both -DFKEYS and -DXKEYS. So let's
enforce that and remove the options.
Mostly mechanical diff from unifdef with bonus removal of comments that no
longer have any relevance.
ok florian@

Revision 1.32 / (download) - annotate - [select for diffs], Sun Nov 16 00:50:00 2014 UTC (9 years, 6 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

scroll_fwd should be const char *

from Kamil Rytarowski (n54 (at) gmx.com)

Revision 1.31 / (download) - annotate - [select for diffs], Sun Nov 16 00:47:35 2014 UTC (9 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

constipate charcost()

from Kamil Rytarowski (n54 (at) gmx.com)

Revision 1.30 / (download) - annotate - [select for diffs], Mon Sep 15 16:11:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, 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
Changes since 1.29: +6 -1 lines
Diff to previous 1.29 (colored)

Enable dirty buffer detection in mg.
Emulate the emacs behavior: after suspend/resume, buffer switch,
or at save time, warn (prompt) the user if the file has been modified
on disk in the interim.
This has already saved my butt numerous times.
ok phessler

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 11 00:03:49 2008 UTC (15 years, 11 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.28: +4 -9 lines
Diff to previous 1.28 (colored)

Let curses handle the setup of terminal instead of doing it on our own
and leaving terminal in an inusable state if setupterm failed.

ok kjell

Revision 1.28 / (download) - annotate - [select for diffs], Tue Aug 1 22:16:03 2006 UTC (17 years, 9 months ago) by jason
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

* move sys/queue.h inclusion to sysdef.h (it's system specific)
* add <signal.h> to sysdef.h (needed for sig_atomic_t on linux, and
we get it by accident on OpenBSD)
* remove <signal.h> from tty.c/spawn.c (not needed now that it's in sysdef.h)
ok beck

Revision 1.27 / (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.26: +2 -2 lines
Diff to previous 1.26 (colored)

lint love; ok kjell

Revision 1.26 / (download) - annotate - [select for diffs], Sat Feb 25 14:40:16 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Fix a coredump occurring when the terminal is resized while mg is
suspended. Problem reported and fixed tested by reyk@; tweak by
kjell@; ok kjell@

Revision 1.25 / (download) - annotate - [select for diffs], Tue Dec 13 19:01:32 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Fix a typo (introduced in rev 1.6) that utterly broke cost calculations.
In theory, mg should now be much more efficient on slow displays (hello,
zaurus).

Spotted by lint. ok millert.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Dec 13 06:01:27 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

More name-clash delinting

Revision 1.23 / (download) - annotate - [select for diffs], Sat Nov 19 20:16:35 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

Clean up some lint.

Revision 1.22 / (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.21: +3 -1 lines
Diff to previous 1.21 (colored)

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

Revision 1.21 / (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.20: +13 -17 lines
Diff to previous 1.20 (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.20 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:48 2003 UTC (20 years, 11 months ago) by deraadt
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, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

mostly ansi cleanup; pval ok

Revision 1.19 / (download) - annotate - [select for diffs], Wed Aug 28 19:48:29 2002 UTC (21 years, 8 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

ANSIfication uncovers function argument bugs. How unusual.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Aug 23 18:43:49 2002 UTC (21 years, 9 months ago) by vincent
Branch: MAIN
Changes since 1.17: +15 -17 lines
Diff to previous 1.17 (colored)

ansi

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jul 1 18:01:40 2002 UTC (21 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.16: +2 -4 lines
Diff to previous 1.16 (colored)

 just make vtresize return TRUE/FALSE instead of 0/-1, for consistency with
the rest of the mg code. + some KNF.

 adapted from diff by zyrnix.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Feb 21 04:16:23 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.15: +2 -7 lines
Diff to previous 1.15 (colored)

remove a wrapper around getenv()

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

signal-safe window size changing

Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:49 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Feb 14 14:24:21 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

some KNF

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 5 20:47:32 2002 UTC (22 years, 3 months ago) by art
Branch: MAIN
Changes since 1.11: +5 -1 lines
Diff to previous 1.11 (colored)

Get rid of signal race (and handling of SIGWINCH).
New code is almost done, but not really tested yet.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jan 18 08:37:08 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.10: +21 -20 lines
Diff to previous 1.10 (colored)

Remove the NROW and NCOL limits. The static arrays are now replaced with
dynamically allocated memory.
Code written by Vincent Labrecque <limitln@Psyfreaks.CA> with some minor
tweaks by me.

Revision 1.10 / (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.9: +32 -25 lines
Diff to previous 1.9 (colored)

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

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

spaces

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

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

Revision 1.7 / (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.6: +2 -0 lines
Diff to previous 1.6 (colored)

$OpenBSD$

Revision 1.6 / (download) - annotate - [select for diffs], Fri Sep 1 14:59:09 2000 UTC (23 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.5: +128 -124 lines
Diff to previous 1.5 (colored)

More -Wall anmd KNF, from op2@tomahawk.SQUiSH.org

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

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

Revision 1.4 / (download) - annotate - [select for diffs], Fri Mar 3 19:31:27 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.3: +13 -0 lines
Diff to previous 1.3 (colored)

Reverse rutgers change (attachtoparent vs. spawncli)

New ttreinit function that enters application mode, enables the keypad
and resets the tty size.

New spawn module that calls tttidy() to exit application mode (and cleanup)
then calls ttreinit() after resume to get back into application mode.  Assumes
we have job control.  This takes advantage of the xterm 'alternate screen'.

Revision 1.3 / (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.2: +4 -2 lines
Diff to previous 1.2 (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.2 / (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.1: +175 -213 lines
Diff to previous 1.1 (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.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.