Commit graph

1857 commits

Author SHA1 Message Date
Russ Cox
dbc153f51e 9term: add threadmaybackground 2020-12-30 10:40:25 -05:00
Russ Cox
74577741c8 tcolors: add threadmaybackground 2020-12-30 08:12:04 -05:00
Nicola Girardi
0a7fe60681 9term: use openpty on NetBSD
Fixes #376.
2020-12-30 07:53:28 -05:00
Russ Cox
8b9aaf2e3f devdraw: add /usr/X11R7 for NetBSD
Fixes #362.
2020-12-30 07:53:28 -05:00
Russ Cox
b3a20a96eb libthread: add threadmaybackground
Programs that want to background themselves now need
to define threadmaybackground returning 1.
This avoids a confusing (to people and debuggers)
extra parent process for all the threaded programs
that will never want to background themselves.
2020-12-30 00:12:14 -05:00
Russ Cox
a012d17433 time: print 1s of milliseconds 2020-12-15 00:06:03 -05:00
Russ Cox
1f098efb73 all: a few more #define tricks for AIX
This should make the AIX build finally work.

Fixes #400.
2020-08-15 20:46:23 -04:00
Russ Cox
9843fc0d82 fontsrv: fix handling of colored glyphs (emoji)
Drawing as white on black to produce a mask only works if
the white on black is the inversion of black on white.
Emoji that force use of specific colors don't respect that.
Draw black on white and invert to mask separately.
2020-08-15 09:10:54 -04:00
James Cook
a1c4307800 touch: fix for OpenBSD.
This fixes https://github.com/9fans/plan9port/issues/436

This doesn't necessarily address the underlying issue: calling p9create with
mode = OREAD should probably be allowed, but currently doesn't work on
OpenBSD.
2020-08-08 12:11:37 -04:00
Igor Böhm
afa34a73a9
devdraw, libdraw: fix memory leaks by freeing getns() malloced string (#431) 2020-07-22 14:59:58 -04:00
Russ Cox
057d8a76a9 acme: add font control message 2020-07-18 21:54:06 -04:00
Russ Cox
95ab1308b4 src/cmd: rm dformat
Unclear why it is here (wkj added it long ago).
It has never been installed into $PLAN9/bin,
so it's doubtful that anyone has ever used it.

Arnold Robbins has an alternate version at
https://github.com/arnoldrobbins/dformat.

Fixes #421.
2020-06-22 11:22:27 -04:00
Gregor Best
c3d31baca0
fontsrv: fix compilation on X11 (#420) 2020-06-04 13:55:26 -04:00
sean
95220bf887 ed: handle Unicode beyond the BMP correctly in list mode.
List mode was constrained to the BMP. This change introduces
the following new list mode convention, using Go string literal syntax:

Non-printing ASCII characters display as \xhh.
Non-ASCII characters in the BMP display as \uhhhh.
Characters beyond the BMP display as \Uhhhhhhhh.
2020-05-29 21:42:23 -04:00
Russ Cox
3850e6e177 devdraw: accept 5- and 6-byte Unicode hex values
Alt X 1234 for U+1234
Alt X X 12345 for U+12345
Alt X X X 103456 for U+103456.
2020-05-29 21:28:59 -04:00
dzklaim
2c70acc3ab
fontsrv: scale f->originy to match f->height on x11
Co-authored-by: dzklaim <smmoth.rp@gmail.com>
2020-05-29 21:02:10 -04:00
Russ Cox
5f0fa185d0 fontsrv: handle non-BMP runes on X11
Have to adjust algorithms to deal with
much larger number of subfont files as well.
2020-05-29 20:58:37 -04:00
Russ Cox
d25d0ca1a3 devdraw, libdraw: handle keyboard runes > U+FFFF
Runes in Plan 9 were limited to the 16-bit BMP when I drew up
the RPC protocol between graphical programs and devdraw
a long time ago. Now that they can be 32-bit, use a 32-bit wire
encoding too. A new message number to avoid problems with
other clients (like 9fans.net/go).

Add keyboard shortcut alt : , for U+1F602, face with tears of joy,
to test that it all works.
2020-05-18 23:45:03 -04:00
Russ Cox
20c841bac1 rc: avoid problematic internal names "var", "thread"
For AIX.
2020-05-18 22:35:17 -04:00
Russ Cox
dea4dbdba6 acme: avoid global named "class"
For AIX.
2020-05-18 22:35:17 -04:00
Russ Cox
d4a4b66a40 diff: rename class to fix AIX
math.h defines a function named class on AIX.
2020-05-18 21:41:35 -04:00
Gabriel Diaz
84167be4ad devdraw: use indirect impl interface in x11 2020-05-18 17:07:25 -04:00
Russ Cox
587933c161 devdraw: use global drawlk instead of per-client
Setting up for a real window system.
2020-05-17 23:24:29 -04:00
Russ Cox
94d381ec9d devdraw: use indirect impl interface
Setting up for a real window system.
2020-05-17 23:19:24 -04:00
Russ Cox
154140a22b mk: replace overlapping strcpy with memmove
Found by ASAN.
2020-05-17 20:15:41 -04:00
Ben Huntsman
5802b09e9d all: fix #includes for AIX, add a few AIX "implementation" files 2020-05-07 20:36:03 -04:00
Ben Huntsman
f84d54a033 mk: support Big Archive Format under AIX 2020-05-07 20:36:03 -04:00
Ben Huntsman
4982d4ebc3 all: update build scripts to fix AIX XL/C compatibility 2020-05-07 20:36:03 -04:00
Russ Cox
601e07b636 rc: clean up parser levels, disallow free carats on lists 2020-05-05 08:30:14 -04:00
Russ Cox
ff74f7cdda rc: allow unquoted = in command arguments
dd fans rejoice!

Also helps with commands like go test -run=x.
2020-05-04 23:41:15 -04:00
Russ Cox
7d6a248f2c rc: move free carat handling into parser
This fixes at least one shell script (printfont) that expected

	'x'`{y}'z'

to mean

	'x'^`{y}^'z'

as it now does. Before it meant:

	'x'^`{y} 'z'

One surprise is that adjacent lists get a free carat:

	(x y z)(1 2 3)

is

	(x1 y2 z3)

This doesn't affect any rc script in Plan 9 or plan9port.
2020-05-04 23:41:15 -04:00
Russ Cox
3caf5c238a rc: move newline handling into parser 2020-05-04 23:41:15 -04:00
Russ Cox
47d4646eeb rc: add recursive descent parser
The old yacc-based parser is available with the -Y flag,
which will probably be removed at some point.

The new -D flag dumps a parse tree of the input,
without executing it. This allows comparing the output
of rc -D and rc -DY on different scripts to see that the
two parsers behave the same.

The rc paper ends by saying:

	It is remarkable that in the four most recent editions of the UNIX
	system programmer’s manual the Bourne shell grammar described in the
	manual page does not admit the command who|wc. This is surely an
	oversight, but it suggests something darker: nobody really knows what
	the Bourne shell’s grammar is. Even examination of the source code is
	little help. The parser is implemented by recursive descent, but the
	routines corresponding to the syntactic categories all have a flag
	argument that subtly changes their operation depending on the context.
	Rc’s parser is implemented using yacc, so I can say precisely what the
	grammar is.

The new recursive descent parser here has no such flags.
It is a straightforward translation of the yacc.

The new parser will make it easier to handle free carats
in more generality as well as potentially allow the use of
unquoted = as a word character.

Going through this exercise has highlighted a few
dark corners here as well. For example, I was surprised to
find that

	x >f | y
	>f x | y

are different commands (the latter redirects y's output).

It is similarly surprising that

	a=b x | y

sets a during the execution of y.

It is also a bit counter-intuitive

	x | y | z
	x | if(c) y | z

are not both 3-phase pipelines.

These are certainly not things we should change, but they
are not entirely obvious from the man page description,
undercutting the quoted claim a bit.

On the other hand, who | wc is clearly accepted by the grammar
in the manual page, and the new parser still handles that test case.
2020-05-04 23:41:15 -04:00
Russ Cox
4650064aa7 acme: scale window bodies on resize, not including tag space
This avoids reopening collapsed windows after a large vertical resize.
2020-03-30 09:56:50 -04:00
Martin Palma
f66f0a587b
devdraw: fix cmd-r to toggle retina vs. non-retina mode on macOS (#361)
and not unexpectedly quitting an application.

Fixes #360
2020-02-03 14:59:58 -05:00
Russ Cox
93e2e820a5 acme: report close failure in Put, this time for sure
Missed in 0b349f6f that Bterm is not closing fd.
2020-01-24 13:09:11 -05:00
Russ Cox
1d0d432ccb devdraw: abort alt sequence on window change on macOS
Fixes #3.
2020-01-16 12:07:47 -05:00
Dan Cross
7bf2db4c2a malloc: remove locking
The issue manifests in fork: POSIX fork mandates that a
fork'd process is created with a single thread.  If a
multithreaded program forks, and some thread was in
malloc() when the fork() happened, then in the child
the lock will be held but there will be no thread to
release it.

We assume the system malloc() must already know how to
deal with this and is thread-safe, but it won't know about
our custom spinlock.  Judging that this is no longer
necessary (the lock code was added 15 years ago) we remove
it.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-16 16:54:19 +00:00
Russ Cox
0be57355f9 devdraw: avoid deadlock in x11 resize
Fixes #347.
2020-01-15 12:01:12 -05:00
Nicola Girardi
4241cae2a1 cmd/rio: xshove: set geometry by window id 2020-01-15 11:55:37 -05:00
Russ Cox
fe2b2de984 devdraw: set windowrect correctly on x11 if window gets unexpected size
Fixes #54.
2020-01-15 11:26:01 -05:00
Russ Cox
ba60bab3cd devdraw: actually send resize event on resize
Fixes #340.
Fixes #343.
2020-01-15 11:09:16 -05:00
Russ Cox
e75dbb6af8 factotum: update for new nbrecvul return value
Unclear whether the old semantics were the right ones,
but at least this preserves what they've been for the past
however many years.
2020-01-15 10:49:28 -05:00
sean
cb58f3291c compress: import Plan9 compress
Add #define USED(x)... boilerplate

compress: import Plan9 manpage.
2020-01-15 10:00:14 -05:00
Dan Cross
6510a2d353 winwatch: Plan 9-ify.
This is new code, and custom to plan9port.  Make it
conform more closely to plan9 style.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-15 09:58:24 -05:00
Dan Cross
0ac4bfee32 clock: Remove unused static variable in clock.c
`struct Tm tms` was set but never referenced; noticed
in a compiler warning.  Remove it.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-15 09:20:41 -05:00
markvanatten
a9b462061c winwatch: port based Plan 9 winwatch
Port of Plan 9's winwatch(1).
2020-01-15 08:43:01 -05:00
Oleg Nemanov
dc24d309d5 9pfuse: update errortab 2020-01-15 08:32:00 -05:00
Russ Cox
5c06214952 venti/buildindex: fix hang on large indexes
Fixes #93.
2020-01-14 19:46:47 -05:00
Russ Cox
1f799495e4 devdraw: notify window resize promptly on x11
Fixes #339.
2020-01-14 19:43:32 -05:00