Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
And make the existing cltr-h handler easier to see.
|
|
Also move the existing backspace lambda out of the loop.
The do_delete() extraction fixes a minor bug where
InputState::ExpectTerminator wasn't entered if delete was pressed at the
very end of a line. Now that this is fixed, there's no more
"LibLine: Unhandled final: 7e (~)" when hitting delete at the end of the
line.
|
|
|
|
|
|
This allows was_resized() to be called while the editor is not active
(i.e. get_line() is not in frame).
|
|
|
|
This commit also updates Shell, which uses actual_rendered_length.
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
Fixes #2525
|
|
The names x and y caused confusion because of their typical use as
horiz/vert.
|
|
This commit makes LibLine handle interrupts (as reported via
interrupted() and resized()) again.
There is a little catch with the shell:
```
$ ls |
pipe> <C-c> (prompt stays here until a key is pressed)
```
|
|
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
|
|
This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
|
|
sequences
We just look at $TERM and refuse to emit any escape sequences if it
doesn't start with "xterm".
This could be made much better, at detecting, and at not caling
getline().
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|