Commit Graph

59 Commits

Author SHA1 Message Date
mergen3107
e95541ffd3 [Kindle NT] fix terminal and timesync (#12765)
Closes #12760
Credits go to @benoit-pierre (Thank you!)
2024-11-23 19:30:48 +01:00
pphszx
bcb7753369 [plugin] Adjust Minimum Font Size in Terminal Emulator (#12752) 2024-11-19 19:18:20 +01:00
hius07
3f8175100a main: logger (#12682) 2024-10-26 17:55:22 +03:00
NiLuJe
83bc531186 Terminal: Tweak the preferred shell order
Keep things least likely to be terrible at being interactive shells
first ;).
We penalize ZSH a bit, because RPROMPTS aren't really handled by the
plugin, which makes things confusing.
2024-10-13 15:02:39 +02:00
zwim
312c3f0d46 Terminal: Move some boilerplate setup code outside of the child shell process
Salvaged from @zwim's original code in #12384
2024-10-13 15:02:39 +02:00
Benoit Pierre
3e5d3044d7 Terminal: Simplify shell selection
Largely based on @benoit-pierre's original patch in https://github.com/koreader/koreader/pull/12384#issuecomment-2298130062
2024-10-13 15:02:39 +02:00
mbays
d097dc0f8c Terminal: Add newline when wrapping
Required to maintain "tty-matrix".
2024-08-31 23:38:37 +02:00
mbays
c2dbd7bf88 Terminal: Don't refresh while input widget closed
Fixes crash on e.g. closing widget after "sleep 3 && echo -e '\eY11'"
2024-08-31 23:38:37 +02:00
mbays
2a39bd15b3 Terminal: Add FIXMEs 2024-08-31 23:38:37 +02:00
mbays
f6ee0aed4f Terminal: Ignore rightChar at end of line 2024-08-31 23:38:37 +02:00
mbays
40034743ad Terminal: Fix handling of '\b' 2024-08-31 23:38:37 +02:00
mbays
f86482c210 Terminal: Remove unnecessary expensive textbox re-inits 2024-08-31 23:38:37 +02:00
mbays
ffd75eb8f1 Terminal: Remove delay on enter 2024-08-31 23:38:37 +02:00
mbays
381a87f9f3 Terminal: Refactor to reduce algorithmic complexity 2024-08-31 23:38:37 +02:00
mbays
1ae38ea8bd Terminal: Ignore ctrl on chars less than '@'
Previous behaviour was to crash.
2024-08-31 23:38:37 +02:00
Rowan Decker
60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
zwim
004311e2aa Fix terminal broken cursor and backspace (#12375)
This shall fix #12271

Use $SHELL env-variable if available. (thanks to @Frenzie)

Use a read line wrapper (either rlfe or rlwrap) if available so that dash can be used as interactive shell.
2024-08-19 20:18:37 +02:00
Benoit Pierre
088ae7d4ee lint: fix issues reported by newer shellcheck / shfmt 2024-06-15 23:02:52 +02:00
NiLuJe
75ffc3bb76 Terminal: Better yet, disable it properly on prereq failure 2024-01-21 06:42:09 +01:00
NiLuJe
a906838123 Terminal: Clearer error message on prereq failures
Pluginloader uses pcall, so, throw with an actual error message

Re: #11394
2024-01-21 06:42:09 +01:00
mergen3107
0d2f8fbb3f Terminal Emulator: Fix former_buffer crash (#11230)
Closes #11229
2023-12-14 21:16:43 +01:00
NiLuJe
eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2022-10-06 19:28:26 +02:00
NiLuJe
fadee1f5dc Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00
zwim
5bcd3d0962 [plugin, Terminal] fix crash on clear screen (#9119)
This fixes https://github.com/koreader/koreader/issues/9108#issuecomment-1132243061

Tapping on clear screen during a running program like top, let's KOReader crash.
2022-06-07 21:06:40 +02:00
zwim
d5d5867d4e DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2022-05-24 00:25:50 +02:00
NiLuJe
5bb22709f7 Terminal: Make sure devpts is mounted on Kobo (#8998)
* Terminal: Make sure devpts is mounted on Kobo

Fix #8986
2022-04-13 00:21:36 +02:00
NiLuJe
2c25181644 Terminal: Make the prerequisites check verbose (#8994)
So we actually have a chance of understanding why it fails to load ;).

(Also, properly require posix FFI stuff, in the unlikely event they aren't already in the main namespace).
2022-04-12 22:45:32 +02:00
NiLuJe
23cd7e24bb Minor Lua I/O cleanups (#8921)
Mostly making sure we always explicitly close io handles.
2022-03-19 23:57:31 +01:00
zwim
eef4dc1c0d Terminal: fix regression from #8845 (#8848)
This should fix a regression introduced with #8845 with reopening a running shell.

Adds more checks and more verbose logging messages on failures.
2022-02-27 12:16:22 +01:00
zwim
1cd396f9c4 Teminal: fix crash when grantpt or unlockpt fail (#8845)
* Fix crash when grantpt or unlockpt fail
* Disable plugin if grantpt or unlockpt fail
2022-02-26 18:16:36 +01:00
Frans de Jonge
67445beea5 [plugin] Terminal: remove stray space at end of string (#8831) 2022-02-20 16:34:32 +01:00
Frans de Jonge
8ff8a05ff3 [plugin] Terminal: move stray newlines outside of translated string (#8830) 2022-02-20 16:08:23 +01:00
Frans de Jonge
4d6a789f6d [plugin] Terminal: fix @translators comments (#8829) 2022-02-20 16:07:57 +01:00
Frans de Jonge
c2812c7956 [plugin] Update capitalization style "Terminal Emulator" → "Terminal emulator" (#8759) 2022-02-01 17:17:22 +01:00
zwim
8cff5f88b0 Teminal emulator: fix translatable, fix potential crash (#8756) 2022-01-31 19:14:29 +01:00
zwim
b924f38dc0 Terminal emulator: fix elinks 'q' crash (#8749)
This fixes a crash in terminal emulator on exit of elinks.
see: https://github.com/koreader/koreader/pull/8636#issuecomment-1024956177
2022-01-30 09:25:35 +01:00
zwim
7220bdea4f [fix, plugin] Terminal ldoc (#8742) 2022-01-28 23:03:31 +01:00
zwim
f2557a7aa6 Terminal emulator: full rewrite, real vt52 emulator (#8636)
New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
2022-01-28 20:33:09 +01:00
hius07
859327dea5 Input dialogs: keep size in rotation (#8223) 2021-09-17 19:36:57 +02:00
yparitcher
f5dc7b4539 Dispatcher: Revamp sections and item order 2021-09-13 10:56:06 -04:00
NiLuJe
03d85bbf99 Terminal: Read settings at instantiation time, not loading time 2021-05-05 20:37:33 +02:00
NiLuJe
bf6c0cdd6c LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
2021-03-06 22:44:18 +01:00
yparitcher
433b82f162 Dispatcher: allow registering actions at runtime 2020-10-20 18:11:55 -04:00
NiLuJe
99045b4311 Minor util & ffi/util cleanups (#6657) 2020-09-15 20:39:32 +02:00
smartscripts-nl
4e281f00ed Dispatcher: adds Show terminal (#6626) 2020-09-03 01:14:06 +02:00
Frans de Jonge
d7aa626ee8 Fix order of requires 2020-09-02 16:10:13 +02:00
smartscripts-nl
20ddad2951 Terminal: add shortcuts for re-useable commands (#6609)
To be able to quickly repeat often used terminal commands
2020-09-02 16:09:27 +02:00
smartscripts-nl
4cff623244 Terminal: support multiple lines and make it re-invokeable (#6599)
With this changes you can enter multiple lines with commands and after viewing the output you can re-invoke the terminal with a button
2020-08-30 12:15:02 +02:00
NiLuJe
1f994f8ede Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
2020-06-13 01:56:36 +02:00
poire-z
55d7109042 Terminal plugin: a few tweaks (#5985)
- Show output in a TextViewer with a monospace font.
- Include stderr, so errors are shown
- Use Trapper to allow interrupting command (and to fix
  some refresh issues)
2020-03-20 23:41:36 +01:00