Age | Commit message (Collapse) | Author |
|
For some reason we were not considering the last *two* characters from
the line's ByteBuffer, with the comment next to it talking about \n and
\0. However the buffer doesn't contain a null-byte, so we were
effectively removing the newline and the last character from each
history line!
|
|
This is implemented in Line::Editor meaning not only the Shell will
respect it, but also js, Debugger etc.
Possible values are "ignorespace", "ignoredups" and "ignoreboth", as
documented in Shell-vars(7), for now.
The default value for the anon user (set in .shellrc) is "ignoreboth".
|
|
This allows us to easily re-use history loading and saving in other
programs using Line::Editor, as well as implementing universally
recognized HISTCONTROL.
|
|
Until we can figure out how shift+enter works (or an alternative), this
can be used to input literal newlines:
```ini
[keybinds]
\\\n=\n
```
|
|
|
|
This makes the completion entry retain information about how much of the
suggestion was part of the string that caused the match.
|
|
|
|
Instead of everyone overriding save_to() and set_property() and doing
a pretty asymmetric job of implementing the various properties, let's
add a bit of structure here.
Object properties are now represented by a Core::Property. Properties
are registered with a getter and setter (optional) in constructors.
I've added some convenience macros for creating and registering
properties, but this does still feel a bit bulky. We'll have to
iterate on this and see where it goes.
|
|
|
|
It does the same thing as Ctrl + Arrow left/right: Wordwise movement.
|
|
xterms send a bitmask (+ 1) in the 2nd CSI parameter if "special"
keys (arrow keys, pgup/down, etc) are sent with modifiers held down.
Serenity's Terminal used to send ^[[O, which is a nonexistent
escape sequence and a misread of VT100's ^[O (ie the '[' is
replaced by 'O'). Since the xterm scheme also supports shift
and alt modifiers, switch to that.
More flexible, and makes ctrl-left/right and alt-left/right work
in SerenityOS's bash port.
Also do this for page up/down.
No behavior change for SerenityOS's Shell.
|
|
No behavior change, but it makes it easy to handle
page up and page down if we wanted to make them do something
in libline.
|
|
This is closer to what other line editors (and shells) do, and makes ^R
actually useful.
|
|
This also makes the editor clean as many lines as the searching took,
for instance, in the case of <C-r><C-c>ls<tab>, two lines should be
cleaned, not just one.
Fixes #3413.
|
|
As opposed to when the cursor is at the start of the buffer.
Fixes #3421.
|
|
Some multikey binding might depend on the suggestion state, and this is
indeed the case for 'reverse tab', which is just '^[[Z'.
Fixes #3407.
|
|
This fixes the following (and more!):
```sh
$ /bin/dis<tab><tab><backspace><backspace><backspace><backspace><tab>
$ /bink_benchmark
```
|
|
Fixes #3270.
Also removes a parameter from search(), as it had no effect.
|
|
I am told that this is how people test their shells.
That's bizarre to me, but sure :^)
|
|
|
|
Makes C-c print "^C" and continue prompting on a new line.
Also fixes a problem where an interrupted get_line() would need more
read()'s than required to update the display.
|
|
Prior to this, no keybinding were installed on the search editor, and so
editing wasn't really possible.
Also fixes <C-r> making infinite search editors.
|
|
This function didn't depend on the editor itself.
|
|
This makes the keybindings that depend on `m_termios` (^W, ^U, etc) work.
|
|
|
|
This moves all internal functions to a new file, and defines the old
keybinds with register_key_input_callback().
|
|
|
|
|
|
|
|
This fixes `> asdf` and allows for all sorts of stdout redirections.
|
|
Only does the 'delete to end of line' bit for now.
No yank ring support yet.
|
|
|
|
It backward-deletes a word like Ctrl-W, but it has a slightly
different definition of what a word is. For example, with the
caret behind `gcc -fsanitize=address`, Ctrl-W would delete
'-fsanitize=address' but Alt-backspace would only delete 'address'.
|
|
All these shortcuts treat consecutive alnums as a word, not consecutive
non-spaces.
For example, `alias KILL='kill -9'` can now be written by typing it
out lowercase, then hitting ctrl-a alt-f alt-u.
Ctrl-W still treats a word as a sequence of non-spaces. Alt-backspace
in a future patch will add the ability to backward-delete a word
that's a sequence of alnums.
|
|
It was only read in should_break_token(), which had no callers.
should_break_token() also got `foo\\ bar` and `"foo bar"` wrong.
|
|
|
|
|
|
|
|
|
|
This adds Alt-f to go forward by a word, and Alt-b to go backward
by a word (like ctrl-arrow-left / ctrl-arrow-right already do).
Behind the scenes, alt-key is implemented by sending <esc> followed
by that key, and typing <esc> f/b for moving by a word hence works
too (in all other shells too, not just in Serenity's).
While here, rename some InputState enum values to make the slightly
expanded use of <esc> clearer, and expand a few comments.
|
|
This time, without trailing 's'. Ran:
git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
|
|
This reverts commit ea9ac3155d1774f13ac4e9a96605c0e85a8f299e.
It replaced "codepoint" with "code_points", not "code_point".
|
|
This makes the line editor behave well when input is passed in from
pipes as well.
|
|
|
|
Unicode calls them "code points" so let's follow their style.
|
|
|
|
|
|
|
|
This way, arrow-left and arrow-right behave consistently with ctrl-b/ctrl-f.
|
|
|