taro-ls: fix div by zero when resetting scrollbar; taro-ctl: use capped IO to truncate command output before writing message
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmQmYogACgkQO3+8IhRO Y5i9Fg//Tz3Abny7NI/Df4YFlqZL6iQt1W0gKiFREwrJZND9lR13mu2i2B+7yLMk eMtUPWbK4ppAqLdZ6TNJWC1BWPQ1P8tLHTrI6ZJLNtBusTI+TSi3k0emdMnWi61o e6HImlFqj6207E3cJB+5Hsj5mPItR9ap9pkzMXFOhi65yns6Z5yrcqOL6RXTGHkU cRqhj0twjDkfpczSe4eSP7SsYG2zNsZ2uqBI0lXDH2zhVo4z4ZhmaEw9LkoKRiqk haMbXEJrcy44spfMXa1f6v6heJKfzygLsIuP19pAm08b5OJaql2jVr+UU2OvqBMA 9atg0vowqQAI3OCsgTyLR9Llij8qvIWmiNaT+3AT3F+NQ4OPDdIMrRMFoDXzp1q3 KKTHjOmlj+NmdmJt9H9Ij7PIao4im9ZopQWkuS8voMg+uXlPUc3OnAzve6QkXvpC mV1hnGtM0v5N4IGSbg7RnQmn1+b+9J9h05tru5qjYf7LSoM+yjpNCLH3PLkRFb1P 4nV17Z1F95S2zCaLa+Qk6xdjr8bVmIf4uo3WWpXViPJPX8RlsZvrwk2UXMfwAzGl lh+dig1Lns18uh2+isfimos7RwQpDFyNHX2B8LlITi4vKYWuo51aWr4wKbt/ivfD lnRkeBtwx1kFdJVYXP59hbn24JnhSRvHtiS7fjzSGbBfAqcD0pY= =lBmR -----END PGP SIGNATURE-----
3 files changed,
18 insertions(+),
5 deletions(-)
M
README.md
→
README.md
@@ -19,9 +19,9 @@
The `config` file is processed into a bunch of constants for `taro-ctl` by the build script. Adjust them to your needs: - `MBOX_ROOT`: the directory where your maildirs are. -- `TARO_LIB`: the directory where your runtime files (`taro-ls` rom, `taro-reader` script, `.theme` and `font.icn` files, etc.) will be installed to; probably just where you clone this repo to. +- `TARO_LIB`: the directory where your runtime files (`taro-ls` rom, `taro-reader` script, `.theme` and `font.icn` files, etc.) will be installed to, as well as a copy of `uxnemu` - `TARO_DOWNLOADS`: directory where attachments are downloaded to. -- `UXN_EMU`: name of the `uxnemu` executable. You can copy `uxnemu` to, eg `taro` and it will have that `_NET_WM_CLASS`. +- `UXN_EMU`: name the `uxnemu` will be copied to - this is a hack to set the `_NET_WM_CLASS`. - `TARO_ENV`: environment variables as you type them in the terminal, that you can use for the `READER_PROG` and `COMPOSE_PROG` commands - `READER_PROG`: command to spawn to read mail - by default it calls the `st` terminal with some environment variables and options set, and runs `taro-reader` - `COMPOSE_PROG`: command to spawn to write mail - by default it calls the `st` terminal with some environment variables and options set and runs `mcom` from `mblaze`@@ -126,7 +126,7 @@ - `7`: refile mail; payload is the beginning and end of the `mmsg` range in u16, and then the mailbox name
- `9`: trash mail; payload is the beginning and end of the `mmsg` range in u16 - `11`: read mail; payload is a single u16 `mmsg` number in the current sequence - `13`: compose mail; no payload -- `15`: push view update (keeps search query, for after replying/writing mail or when new mail comes in) +- `15`: push view update (keeps search query, for after replying/writing mail or when new mail comes in); no payload ## socket (other IPC)
M
taro-ctl.cr
→
taro-ctl.cr
@@ -166,6 +166,16 @@ end
end + class CappedIO < IO::Memory + def write(slice : Bytes) + if slice.size >= MSG_SIZES[MsgType::MAIL_LIST] + super(slice[0..MSG_SIZES[MsgType::MAIL_LIST] - 1]) + else + super(slice) + end + end + end + class MblazeProxy @@mailbox : String = "INBOX" @@search_regex : String = ""@@ -179,7 +189,7 @@ @@search_regex
end private def run_cmd(cmdtxt : String) : IO::Memory - io = IO::Memory.new + io = CappedIO.new Process.run(cmdtxt, shell: true, output: io) return io end
M
taro-ls.tal
→
taro-ls.tal
@@ -1118,7 +1118,10 @@ POPr
JMP2r @update_sb_pos ( list -- ) - + DUP SB_STEP LDZ2 #0000 NEQ2 ,&safe_to_divide JCN + POP JMP2r + + &safe_to_divide DUP DUP LB_TOP LDZ2 ROT SB_STEP LDZ2 DIV2 ROT SB_POS STZ2