summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-06Allow empty context-aware completionBert Münnich
We do not want to fall back to filename completion just because the context-aware completion did not produce any matches.
2019-12-06Fix tab completion of quoted commands and variablesBert Münnich
An open quoted string was always completed as a filename. The type of completion is now guessed based on the token preceding the opening quote in the same way as it is done for unqoted words. ; 'fals -> ; 'false' ; echo $'hom -> ; echo $'home'
2019-12-06Report children as soon as possible when waiting for allBert Münnich
The following example demonstrates the problem: ; false & sleep 300 & wait 2317 # pid of false 2318 # pid of sleep # blocking for 300s 2318: done (0) 2817: done (1) With this commit the status for false is reported instantly: ; false & sleep 300 & wait 4205 # pid of false 4206 # pid of sleep 4205: done (1) # blocking for 300s 4206: done (0)
2019-12-06Simplify string creation in completionBert Münnich
2019-12-06Remove useless unquote functionBert Münnich
It is only needed for completing an open quoted string with an escaped quote: 'it''s alive Unfortunately, readline will always treat the last quote character as the start of the string so that unquote only gets called on "s alive".
2019-12-06Properly complete subdirs in $pathBert Münnich
Quote from the comment on the *bodge* mechanism: (It would be better to persuade readline just to append the "/" as it does for filename completion, but it's not clear to me if this is possible.) Readline has the *rl_completion_append_character* variable for exactly that.
2019-12-06Fix command completion of absolute pathsBert Münnich
2019-03-24Correctly name real-time signalsBert Münnich
Also make names of unknown signals use fmt 'sig%d' instead of 'sigunknown%d'.
2019-03-24Revise status messages for terminated childrenBert Münnich
Print a status message for a terminated child if: 1) the wait builtin is called in an interactive shell, or 2) the child terminated due to a signal and it is not sigint and not sigpipe or it caused the child to dump core. The messages are of the form: [pid:] <signal message[--core dumped] | done (status)> Before this, there were various inconsistencies, e.g. the wait builtin-- regardless if called in an interactive shell or script--would print just the pid and a colon w/o a message and w/o a newline if the child it waited for terminated due to receiving sigint.
2018-12-29Glob matching in linear timeBert Münnich
As described by Russ Cox: https://research.swtch.com/glob The exponential complexity of the old implementation was not a real problem, though, as no glob triggering excessive backtracking has ever been spotted in the wild.
2018-12-29Restore tty attributes if interactive child is terminated by signalBert Münnich
Some programs like su(1) do not restore tty attributes like ECHO when they are terminated by receiving SIGINT. Other shells (bash, mksh, zsh) save tty attributes before executing an external command and restore them if the child exited due to the receipt of a signal. rc now does the same if it is interactive.
2018-12-29Set LC_CTYPE after reading ~/.rcrcBert Münnich
rc does not handle umlauts correctly, if locale environment variables are first set in ~/.rcrc. It is necessary to update the environment before calling setlocale(3) because it would otherwise not see the variable values assigned in ~/.rcrc.
2018-12-29Prevent duplicate lines in readline historyBert Münnich
Before appending a new line to the readline history, remove all prior lines in the history, which are an exact duplicate of it.
2018-12-29Handwritten Makefile and config.h; no more GNU autohellBert Münnich
2018-12-29Remove duplicate line editing unitBert Münnich
edit-bsd.c was a copy of edit-edit.c.
2018-08-19do not permit "if not" after "if ... else"Toby Goodwin
2018-08-19add failing test for else / if not caseToby Goodwin
2018-08-08minor tidyupsToby Goodwin
2018-08-08Cleaner string for testDrazen Borkovic
2018-08-08Test for if-not issueDrazen Borkovic
2018-08-08improved implementation of if_state inspired by borkovicToby Goodwin
2018-05-30if_state was being clobbered while running body of succeeding ifToby Goodwin
2018-05-30tweak ChangeLogToby Goodwin
2018-05-30Merge branch 'master' of github.com:rakitzis/rcToby Goodwin
2018-05-30very minor cleanupsToby Goodwin
2018-05-02Merge pull request #47 from muennich/ifnot-conflictsToby Goodwin
Silence parser conflicts caused by IF NOT
2018-05-01Silence parser conflicts caused by IF NOTBert Münnich
2018-05-01implement quoting for command completionToby Goodwin
2018-05-01quoting functions mean filename completion mostly works for names containing "'"Toby Goodwin
2018-04-29minor cleanupsToby Goodwin
2018-04-28support completion through subdirs of pathToby Goodwin
2018-04-28check access of external commands when completingToby Goodwin
2018-04-28eliminate goto... clearer?Toby Goodwin
2018-04-26Always insert single match of explicit complete functionBert Münnich
If an explicit complete function has only one match but is used directly after the default tab completion, than the single match is shown instead of inserted. The solution is resetting the 'rl_last_func' variable if it is set to 'rl_complete' when using an explicit complete function.
2018-04-26Custom readline commands for explicit completionsBert Münnich
New commands: - rc-complete-command, per default bound to "M-!" - rc-complete-filename, "M-/" - rc-complete-variable, "M-$" These commands are useful, if one wants a specific type of completion which is not performed by the context-senstive default one, e.g. filename completion at the beginning of the line or command completion for the second word (after sudo). The readline code now also sets the application name to "rc", making it possible to specify different bindings for these commands in ~/.inputrc: $if rc "\C-x\C-[": rc-complete-command "\C-[\C-x": rc-complete-filename "\C-x\C-v": rc-complete-variable $endif
2018-04-26Completion of command names and variablesBert Münnich
New completion entry functions for readline specific code: - compl_var for variables - compl_fn for functions - compl_builtin for builtins - compl_extcmd for external commands in path - compl_command, which combines the last three The first three are simple wrappers for compl_name, which iterates over a typical rc table (an array of structs) yielding the name fields. The appropriate completion entry function is chosen based on the character/token that preceeds the word to complete: '$' for variable, beginning of line or one of [`@|&(){;] for command. Otherwise the shell falls back to readline's default completion, which it also does, if the chosen completion entry function finds no match.
2018-04-25bring ChangeLog up to dateToby Goodwin
2018-04-20new mkinstalldirs for some reasonToby Goodwin
2018-04-20replace space used to terminate heredocToby Goodwin
2018-03-26Merge branch 'master' into ifnotToby Goodwin
2018-03-26whitespace cleanupsToby Goodwin
2018-03-20whitespace cleanupToby Goodwin
2018-03-19Merge branch 'master' into ifnotToby Goodwin
2018-03-19implement $nl and $tab, issue #43Toby Goodwin
2018-03-19implement desugaring version (again, lost due to git problem)Toby Goodwin
2018-03-17Merge branch 'master' into ifnotToby Goodwin
2018-03-17fix bad merge fixupToby Goodwin
2018-03-17Merge branch 'continue'Toby Goodwin
2018-03-17tidy up, test cases, document flagToby Goodwin
2018-03-16flag largely working, flag n + is a bit oddToby Goodwin