about summary refs log tree commit diff
path: root/saneterm
Commit message (Collapse)AuthorAgeFilesLines
* Add ctrl+l keybinding to clear everything except current lineSören Tempel2021-05-292-0/+11
|
* Only import gi (and specify Gtk version) onceSören Tempel2021-05-294-9/+2
|
* 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).
* Limit amount of lines stored in buffer using command-line flagSören Tempel2021-05-292-3/+5
|
* termview: Allow limiting the amount of lines stored in used bufferSören Tempel2021-05-291-4/+36
|
* 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.
* history: Add explicit ORDER BY to get_entrySören Tempel2021-05-251-1/+1
| | | | Should be the default behaviour though.
* history: Clarify HISTFILE commentSören Tempel2021-05-241-1/+2
|
* history: add docstring to History classSören Tempel2021-05-241-0/+4
|
* history: Add To-Do regarding employed SQL queriesSören Tempel2021-05-241-0/+2
|
* history: add docstring to get_entrySören Tempel2021-05-241-0/+5
|
* Make sure history does not go out-of-boundsSören Tempel2021-05-242-5/+14
| | | | | | Return None if no history entry was found and reset the offset if so. Without this patch the offset would be continuously incremented/decrement.
* history: Use .rstrip() for removing trailing newlinesSören Tempel2021-05-241-5/+2
|
* history: Strip entries if HISTSIZE is exceededSören Tempel2021-05-241-2/+15
|
* Add preliminary support for executable-specific historySören Tempel2021-05-244-0/+107
| | | | | | The current executable is determined by using tcgetpgrp on the PTY file descriptor. All history entries are stored in an SQL lite database on a per-line basis.
* terminal: Use Gtk.CheckMenuItem for config optionsSören Tempel2021-05-241-6/+3
|
* Make wordwrap configurable using context menuSören Tempel2021-05-241-14/+25
|
* Use activate instead of select signal for MenuItemSören Tempel2021-05-241-1/+1
|
* Toggle autoscroll via context menuSören Tempel2021-05-241-0/+21
|
* terminal: Autoscroll by defaultSören Tempel2021-05-241-4/+11
| | | | | This should be made configurable using the context menu and/or a keybinding in future commits.
* terminal: Use configure-event to detect resizeSören Tempel2021-05-241-1/+1
|
* Add custom delete-from-cursor implementationSören Tempel2021-05-231-0/+21
| | | | | | | This one checks for the output point explicitly and does not allow movements to go beyond it. To test this, try a shell with `PS1='>'` (i.e. no space after the prompt character) and try ctrl+w. Without this patch, words in the previous line would be deleted.
* Launch $SHELL by default if it is setsternenseemann2021-05-231-1/+4
| | | | | | | | | | | | In an user environment (which saneterm would usually be executed in) $SHELL should point to the current user's login shell as per environ(7). On startup, check if the variable is set and use it to populate the default command to run if it is, otherwise fall back to `sh` like before. I believe this is the correct change even if it gives users (including me) more trouble since many login shells people will use (like fish) don't work well in saneterm, whereas /bin/sh usually will work fine.
* Enable <ctrl>w keybinding by defaultSören Tempel2021-05-231-1/+3
|
* Remove code duplication in cursor_at_{end,out}Sören Tempel2021-05-231-10/+7
|
* termview: Ensure that cursor is not part of a selectionSören Tempel2021-05-231-0/+6
| | | | | | | Otherwise, when typing a word directly after the output point selecting this word and attempting to delete it using backspace doesn't work. Seems to me, if text is selected Gtk treats the beginning of this selected test as the current cursor position.
* Unbind ctrl+vSören Tempel2021-05-231-0/+3
|
* Use relative importssterni2021-05-232-3/+3
| | | | | | | | | | Seems to make things easier when actually installing saneterm (or at least I wouldn't know how to make it work without relative or absoulte imports). However this breaks executing the __main__.py script directly which is replaceable by using python -msaneterm which seems fine. Preserving the __main__.py seems to only be possible using self modifying PYTHOPATH which is just ugly.
* Configure TermView input hintsSören Tempel2021-05-231-0/+2
|
* Implement support for retrieving terminal windows sizeSören Tempel2021-05-231-0/+27
| | | | | Even if TUIs are not supported, this is used by some applications (most notably) ls(1) for outputting text in multiple columns.
* termview: Use a monospaced fontSören Tempel2021-05-231-0/+1
| | | | | Required by application such as ls which assume that every printed character has the same width.
* Add ctrl+j bindingSören Tempel2021-05-231-0/+1
|
* Add binding for ctrl+hSören Tempel2021-05-231-0/+1
|
* Ignore termios control characters if cursor is not at endSören Tempel2021-05-222-1/+11
| | | | | | | To me it seems somewhat unintuitive if ctrl+d causes VEOF if your cursor is not at the point where you would normally enter the next character. With this commit, all termios control keybindings are a NOPs in this case.
* termview: Split cursor_at_end method from backspaceSören Tempel2021-05-221-5/+6
|
* Rename input.py to keys.pySören Tempel2021-05-222-11/+13
| | | | Also move default control character mappings to this module.
* terminal: Add support for VEOFSören Tempel2021-05-221-0/+4
|
* saneterm: Separate flush from __end_user_actionSören Tempel2021-05-221-12/+16
| | | | Useful for flushing buffer on VEOF.
* Preliminary support for scrollingSören Tempel2021-05-221-1/+5
|
* Move control key definition to dictionarySören Tempel2021-05-221-2/+8
|
* Add keybinding for VSUSP (ctrl+z)Sören Tempel2021-05-221-0/+1
|
* Generalize support for termios-keybindingsSören Tempel2021-05-223-13/+30
|
* Add comment regarding potential quirk of interrupt methodSören Tempel2021-05-221-0/+4
|
* Don't start shell with clean environmentSören Tempel2021-05-201-1/+2
|
* Read up-to 4096 bytes in handle_pty callbackSören Tempel2021-05-201-2/+1
|