summaryrefslogtreecommitdiffstats
path: root/src/cmd
Commit message (Collapse)AuthorAgeFilesLines
* eqn: enlarge errbuf to account for large tokensXiao-Yong Jin2021-01-292-2/+2
|
* xd: fix swizz8 loop countingXiao-Yong Jin2021-01-291-1/+1
|
* sam: avoid out-of-bounds read in rtermRuss Cox2021-01-141-2/+2
| | | | | | | | | | | Usually r->nused < r->nalloc and the read is in bounds. But it could in theory be right on the line and reading past the end of the allocation. Make it safe but preserve as much of the old semantics as possible. This use of rterm appears to be only for optimization purposes so the result does not matter for correctness.
* sam: remove backward ?:Russ Cox2021-01-141-1/+1
| | | | The exit code here is ignored anyway.
* rc: do not exit on EINTR from readRuss Cox2021-01-141-1/+10
| | | | This happens if lldb attaches to rc.
* auxstats: do not postnote 0Russ Cox2021-01-141-1/+2
|
* acme, sam, samterm: remove weird switch usageRuss Cox2021-01-054-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | For whatever reason all three of these programs contain switches like: switch(x) { case 1: if(cond) case 2: f(); } Like Duff's device, this is legal C but more obscure than it really needs to be. This commit assumes those are intended as written and simply writes them more clearly. I did consider that maybe they are mistakes, but in the case of sam/regexp.c, my rewrite in this commit matches the acme/regx.c that has been in plan9port since I added acme in 2003. (I didn't bother to dig up the old Plan 9 releases.) Assuming acme/regx.c has been correct for the past two decades, this commit should be correct too.
* sam: rm dregsRuss Cox2021-01-054-293/+0
|
* stats: add threadmaybackgroundRuss Cox2021-01-055-40/+49
|
* acme: allow @ in file namesRuss Cox2020-12-301-1/+1
| | | | For upspin and other tools that put email addresses in names.
* 9term: add threadmaybackgroundRuss Cox2020-12-301-0/+6
|
* tcolors: add threadmaybackgroundRuss Cox2020-12-301-0/+6
|
* 9term: use openpty on NetBSDNicola Girardi2020-12-301-0/+16
| | | | Fixes #376.
* devdraw: add /usr/X11R7 for NetBSDRuss Cox2020-12-301-0/+2
| | | | Fixes #362.
* libthread: add threadmaybackgroundRuss Cox2020-12-3012-0/+72
| | | | | | | | 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.
* time: print 1s of millisecondsRuss Cox2020-12-151-3/+3
|
* all: a few more #define tricks for AIXRuss Cox2020-08-151-0/+3
| | | | | | This should make the AIX build finally work. Fixes #400.
* fontsrv: fix handling of colored glyphs (emoji)Russ Cox2020-08-151-5/+17
| | | | | | | 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.
* touch: fix for OpenBSD.James Cook2020-08-081-1/+1
| | | | | | | | 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.
* devdraw, libdraw: fix memory leaks by freeing getns() malloced string (#431)Igor Böhm2020-07-221-2/+6
|
* acme: add font control messageRuss Cox2020-07-181-0/+18
|
* src/cmd: rm dformatRuss Cox2020-06-221-108/+0
| | | | | | | | | | | 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.
* fontsrv: fix compilation on X11 (#420)Gregor Best2020-06-041-0/+1
|
* ed: handle Unicode beyond the BMP correctly in list mode.sean2020-05-291-9/+32
| | | | | | | | | 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.
* devdraw: accept 5- and 6-byte Unicode hex valuesRuss Cox2020-05-291-8/+31
| | | | | | Alt X 1234 for U+1234 Alt X X 12345 for U+12345 Alt X X X 103456 for U+103456.
* fontsrv: scale f->originy to match f->height on x11dzklaim2020-05-291-1/+1
| | | Co-authored-by: dzklaim <smmoth.rp@gmail.com>
* fontsrv: handle non-BMP runes on X11Russ Cox2020-05-294-43/+44
| | | | | Have to adjust algorithms to deal with much larger number of subfont files as well.
* devdraw, libdraw: handle keyboard runes > U+FFFFRuss Cox2020-05-182-3/+8
| | | | | | | | | | | 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.
* rc: avoid problematic internal names "var", "thread"Russ Cox2020-05-181-0/+6
| | | | For AIX.
* acme: avoid global named "class"Russ Cox2020-05-181-0/+3
| | | | For AIX.
* diff: rename class to fix AIXRuss Cox2020-05-181-0/+3
| | | | math.h defines a function named class on AIX.
* devdraw: use indirect impl interface in x11Gabriel Diaz2020-05-181-0/+21
|
* devdraw: use global drawlk instead of per-clientRuss Cox2020-05-173-18/+20
| | | | Setting up for a real window system.
* devdraw: use indirect impl interfaceRuss Cox2020-05-174-30/+61
| | | | Setting up for a real window system.
* mk: replace overlapping strcpy with memmoveRuss Cox2020-05-171-1/+2
| | | | Found by ASAN.
* all: fix #includes for AIX, add a few AIX "implementation" filesBen Huntsman2020-05-075-0/+17
|
* mk: support Big Archive Format under AIXBen Huntsman2020-05-071-0/+4
|
* all: update build scripts to fix AIX XL/C compatibilityBen Huntsman2020-05-071-1/+1
|
* rc: clean up parser levels, disallow free carats on listsRuss Cox2020-05-054-31/+37
|
* rc: allow unquoted = in command argumentsRuss Cox2020-05-042-10/+27
| | | | | | dd fans rejoice! Also helps with commands like go test -run=x.
* rc: move free carat handling into parserRuss Cox2020-05-044-74/+103
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* rc: move newline handling into parserRuss Cox2020-05-046-24/+67
|
* rc: add recursive descent parserRuss Cox2020-05-0413-9/+730
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* acme: scale window bodies on resize, not including tag spaceRuss Cox2020-03-301-3/+5
| | | | This avoids reopening collapsed windows after a large vertical resize.
* devdraw: fix `cmd-r` to toggle retina vs. non-retina mode on macOS (#361)Martin Palma2020-02-031-1/+1
| | | | | and not unexpectedly quitting an application. Fixes #360
* acme: report close failure in Put, this time for sureRuss Cox2020-01-241-5/+5
| | | | Missed in 0b349f6f that Bterm is not closing fd.
* devdraw: abort alt sequence on window change on macOSRuss Cox2020-01-161-0/+4
| | | | Fixes #3.
* malloc: remove lockingDan Cross2020-01-161-10/+0
| | | | | | | | | | | | | | | | | 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>
* devdraw: avoid deadlock in x11 resizeRuss Cox2020-01-152-0/+3
| | | | Fixes #347.
* cmd/rio: xshove: set geometry by window idNicola Girardi2020-01-151-1/+6
|