about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Add remaining todo to insert_data crSören Tempel2021-06-301-0/+1
|
* fixup! Preliminary support for carriage returnSören Tempel2021-06-303-18/+10
|
* Preliminary support for carriage returnSören Tempel2021-06-293-0/+32
|
* Move Pty related classes to own module/fileSören Tempel2021-06-292-50/+54
|
* Support bell character by parsing pty input into eventssterni2021-06-292-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new object, the PtyParser, which will be handling pty input in the future. It receives (utf-8 decoded) input and emits a series of events which encode pty output we want to represent in the UI: * The most basic event type is TEXT which is plain text we need to add to the TermBuffer. * Additionally BELL is now supported which indicates we want to beep (if enabled in gtk) and set the urgency flag of the window. Events seems to be a simple way to indicate future special behavior and by splitting the data read from the pty we can easily skip control characters which we don't want to render (and thus get rid of ugly codepoint boxes). Due to the use of yield and string slices, this approach should also be efficient enough. Using events instead of triggering the desired action in handle_pty ad-hoc also has the advantage that we can split the parsing logic into a separate object which is interesting for the following reasons: * Especially when we want to support a subset of ANSI control sequences we'll need to track parser state: - ANSI escape sequences are multiple codepoints long, so we need to track a parser state in order to keep it incremental. - ANSI escape sequences allow changing the font properties (style, weight, color) which is implemented in a stateful way, we'll also need to keep track of. * The parser is implemented independently of the rest of the application and especially the UI, so we'll be able to unit test it easily.
* Add Shift-Insert keybinding to paste primary clipboardSören Tempel2021-06-263-1/+9
| | | | | | | This is basically yet another workaround for a bug in Gtk since Gtk pastes the secondary clipboard by default. However, since every terminal emulator I have used in the past pastes the primary clipboard on Shift-Insert saneterm should too.
* termview: Rename LimitTextBuffer to TermBufferSören Tempel2021-06-261-3/+4
| | | | More accurate since it also handles copy/paste stuff now.
* search: Don't focus navigation button on clickSören Tempel2021-06-091-0/+1
| | | | | | This way, the search_entry itself is not unfocused and key combinations like ctrl+g and ctrl+shift+g, which cycle through matched strings, continue to work.
* saneterm: move search bar to top of windowSören Tempel2021-06-081-3/+3
| | | | | | This is what most applications (with the exception of firefox) do. Notably, this is also what evince does which inspired the design of the current search bar version.
* Add buttons to search bar for cycling through matchesSören Tempel2021-06-082-3/+32
| | | | | | Currently there are still some focus issue, i.e. if the button are pressed these are focused and the Ctrl+G/Ctrl+Shift+G keybindings no longer work. That will be fixed in a future commit.
* completion: also match paths containing a ~ characterSören Tempel2021-06-061-0/+5
| | | | | Currently, the tilde character is not replaced by $HOME in the file name which may cause issues with application not expanding tilde themselves.
* TODO.txt: Update with stuff I noticed the past few daysSören Tempel2021-06-041-4/+19
|
* Improve custom delete_from_cursor implementationSören Tempel2021-06-041-10/+14
| | | | | * Fix Gtk.TextIter movement * Only handle movements of type WORD_ENDS for now
* Prevent Gtk from clearing the primary selectionSören Tempel2021-06-031-0/+20
| | | | This is a horrible workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/317
* README.md: Add FAQ entry regarding primary clipboard handlingSören Tempel2021-06-031-0/+8
|
* completion: suggest shortest match firstSören Tempel2021-06-021-0/+3
|
* TODO.txt: Update and clarify some entriesSören Tempel2021-06-021-2/+9
|
* termview: update _last_mark even on newlineSören Tempel2021-06-011-2/+1
| | | | | | | | Most REPLs will write a new prompt on newline but when starting a graphical application from a shell (e.g. gitk) no output will be written to the PTY after the newline. This causes _last_mark to not be updated and causes cursor_at_end to always return False making it impossible to quit the application using termios.VINTR.
* termview: assign name and func in loop conditionSören Tempel2021-06-011-2/+1
|
* Allow toggling wordwrap/autoscroll using a key bindingSören Tempel2021-06-012-6/+11
| | | | | | I find it somewhat unpleasent to heavily rely on the mouse. Especially considering that toggeling autoscroll is something I do a lot (e.g. when using cat(1) on a text document).
* terminal: Create terminal-specific action signals using a dictSören Tempel2021-06-011-7/+10
|
* Add command-line flag to hide the vertical scrollbarSören Tempel2021-06-012-2/+8
| | | | | Unfortunately, it does not seem to be possible to hide the scrollbar using the standard Gtk CSS configuration mechanism.
* README.md: Update FAQ to mention implemented buffer searchSören Tempel2021-06-011-2/+2
|
* TODO.txt: Add todo entry regarding echo modeSören Tempel2021-05-311-1/+4
|
* README.md: Fix font configuration in example CSS configuration fileSören Tempel2021-05-311-4/+8
|
* README.md: Change cursor color too in configuration exampleSören Tempel2021-05-311-0/+1
|
* completion: Fix check for absolute pathSören Tempel2021-05-311-1/+1
|
* README.md: Update features sectionSören Tempel2021-05-311-7/+4
|
* TODO.txt: UpdateSören Tempel2021-05-311-2/+0
|
* Document limitation of __clear_viewSören Tempel2021-05-311-0/+1
|
* Add comment to update_sizeSören Tempel2021-05-311-0/+6
|
* Preliminary tab completion supportSören Tempel2021-05-315-3/+136
|
* Scroll to string matched by SearchBarSören Tempel2021-05-302-4/+7
|
* terminal: Restore focus to TermView after closing SearchBarSören Tempel2021-05-301-0/+9
|
* Preliminary TextBuffer SearchBar supportSören Tempel2021-05-303-3/+83
| | | | | | Still lacking some configuration options (highlight all, case insensitive search, …) and focus is not currently restored to the TermView on close currently.
* Add ctrl+l keybinding to clear everything except current lineSören Tempel2021-05-293-2/+11
|
* Only import gi (and specify Gtk version) onceSören Tempel2021-05-294-9/+2
|
* README.md: Update short descriptionSören Tempel2021-05-291-1/+1
|
* terminal: Reduce priority of PTY SourceSören Tempel2021-05-291-0/+1
| | | | | With the default priority, the rendering thread would starve if the PTY already has input ready. For example, when executing yes(1).
* Merge branch 'limit-scroll-buffer'Sören Tempel2021-05-294-10/+41
|\
| * Limit amount of lines stored in buffer using command-line flagSören Tempel2021-05-293-6/+5
| |
| * termview: Allow limiting the amount of lines stored in used bufferSören Tempel2021-05-291-4/+36
|/
* TODO.txt: UpdateSören Tempel2021-05-261-3/+7
|
* Update documentation to reflect addition of history supportSören Tempel2021-05-262-2/+1
|
* history: simplify get_entry query even furtherSören Tempel2021-05-261-2/+1
| | | | | | Since 61ca4b802c7df75de8a31c6e409eeae15190accf the explicit size check should no longer be needed, i.e. offset selects nothing already if the offset exceeds the amount of available entries.
* terminal: Reset self.reset_history_index() directlySören Tempel2021-05-251-5/+3
| | | | | after reaching current entry. While at it, also attempt to clarify the comment.
* Clear the line if Down is pressed at the most recent history entrysterni2021-05-251-5/+16
| | | | | | | | | | | This mimicks the behavior familiar from most shells. We also make sure that this doesn't happen when we hit the oldest history entry -- in that case we will just do nothing if Up is pressed. To implement this correctly we need to distinguish between a position in the history and no position in the history. We encode the latter using `None` and just call `reset_history_index()` in case we encounter it to reacquire a point of reference.
* terminal: Use single case distinction to set hscroll/wrapmodeSören Tempel2021-05-251-4/+14
| | | | | Makes the code a bit more readable IMHO. Also add a comment explaining why we can't use use automatic horizontal scrolling in the first place.
* Add workaround for annoying scrollbar if wordwrap is enabledsterni2021-05-252-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | There is an issue [1] in GTK 3 which causes the automatic hyphenation of GtkTextViews to cause a horizontal scroll bar to appear despite it being not necessary (in our case the horizontal scrollbar is rendered over the hyphens which is hardly cause for concern). Ideally we would just disable auto hyphenation, but this doesn't seem to be possible [2] in GTK 3 yet. As a workaround we just disable horizontal scrolling altogether in in update_wrapmode() if wordwrap is enabled. While we're at it add a note about the GTK 4 feature [3] which would allow us to disable auto hyphenation. For GTK 3 it seems to require to set a pango [4] attribute in the pango layout used for rendering the widget which is not exposed in a modifiable way by GtkTextView unfortunately -- or at least I haven't been able to figure out how the desired result could be achieved. [1]: https://gitlab.gnome.org/GNOME/gtk/-/issues/2384 [2]: https://gitlab.gnome.org/GNOME/gtk/-/issues/2530 [3]: https://docs.gtk.org/gtk4/property.TextTag.insert-hyphens.html [4]: See these solutions of other projects that ran into this issue: https://github.com/mate-desktop/caja/pull/1334 https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/482
* history: simplify get_entry querySören Tempel2021-05-252-3/+5
| | | | | By sorting rows in descending order instead of performing an arithmetic operation on the maximum value.