MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Kindle Developer's Corner (https://www.mobileread.com/forums/forumdisplay.php?f=150)
-   -   One more terminal emulator for kindle. (https://www.mobileread.com/forums/showthread.php?t=154500)

Matan 10-23-2011 09:14 PM

One more terminal emulator for kindle.
 
1 Attachment(s)
I worked a little on kiterm and produced a version that works alongside launchpad, instead of replacing it. This file can be installed by using launchpad installation (copy to /mnt/us/customupdates and press shift shift I), or directly by unzipping under /mnt/us.

Source code is at: http://my.svgalib.org/kindle/myts-6.tar.gz

Changes compared to lrizzo's kiterm (and to modifications by Xqtftqx, PoP, dsmid):
  1. Does not replace launchpad, but uses already installed launchpad.
  2. Does not have http server functionality.
  3. Full screen.
  4. Character encoding and font not compiled in.
  5. Font sizes configurable.
  6. Supports UTF8 as well as 8 bit encodings.
  7. Scroll back buffer.
  8. Minor bugfixes
    • Line wrapping support.
    • A few more control sequences.
    • Odd width fonts supported.


After installing, the default launchpad configuration (in the file /mnt/us/launchpad/myts.l.ini) is:
T T = start (or return to) terminal 1
T Y = start (or return to) terminal 2
T U = start (or return to) terminal 3
T A = kill myts

To display the keyboard mapping press any modifier (shift, menu, back, aA) and exit button (by default Left<).

Code:

Menu:
F1 F2 F3 F4 F5 F6 F7 F8 F9  F10
`  %  ^  <  >  [  ]  =  F11 F12
\t  ;  ,  (  )  {  }
 
 
Back:

!  @  #  $  %  ^  &  *  (  )
'  +  #  -  _  (  )  &  !  ?
~  $  |  /  \  "  '  :

The symbols produced by Back key are configurable.

Fonts use "hex" format. A perl script is included that converts bdf fonts to hex. Since the fonts do not include width/height information, this must be provided in the configuration file (/mnt/us/myts/myts.ini). Fonts of width at most 8 may be used.

An encoding file is simply a 512 bytes binary file where the nth 16 bit word is the unicode value of char n. A script to generate such files is included.

To enable the scroll back buffer, use the configuration file option ScrollbackLines to set the number of lines saved in the buffer. A value of 0 (default) disables scroll back. I the default configuration file, the right page scrolling keys are used for scrollback, but this is configurable.

Xqtftqx 10-23-2011 10:22 PM

Great work! I haven't had time to try it out but it looks very nice!

dsmid 10-24-2011 05:40 AM

Very nice, Matan. It's almost perfect.
I miss one feature though.
I always keep forgetting the keyboard mapping and it would be great to be able to quickly toggle displaying current mapping with a key stroke.

dasmoover 10-24-2011 07:34 AM

@dsmid echo "cat /mnt/us/myts/printkeys.txt" >> /usr/bin/printkeys
then write the keymap to the text file.

@OP, awesome work man, kiterm stopped working today and this works beautifully. Would you be able to add ctrl modifier support?

wiccan2 10-24-2011 08:30 AM

This looks like it will be great, will try it out later after work.

Does this version still support tab through back + a. I found this very useful in the full screen version of he previous terminal emulator as it allows you to use tab complete for commands.

My kindle is in need of some clean up on the side of terminal emulators and opt ware. At least I now have an excuse to switch to launchpad and clean up my root partition.

Matan 10-24-2011 09:33 AM

aA key is ctrl (configurable). This did not change from kiterm

Tab is Menu+z. (listed as \t in the keymap).

For file name completion in shell you can use ctrl+i when Tab is not available.

dsmid 10-24-2011 10:39 AM

Quote:

Originally Posted by dasmoover (Post 1800483)
@dsmid echo "cat /mnt/us/myts/printkeys.txt" >> /usr/bin/printkeys
then write the keymap to the text file.

Good idea, it doesn't have to be /usr/bin/, I'd rather use /mnt/us/ as I have it in my PATH anyway.
When I think about it, it doesn't have to be a script, an alias seems to be more suitable.
It's still more a workaround then a solution. Often you need to display the mapping after typing long command. Maybe I could dedicate one terminal instance for displaying help.

Matan 10-24-2011 02:27 PM

I update first post with new version, which includes keymap display screen (modifier+exit button) this screen is displayed while the key is pressed.

I have three test cases and they all have issues:

top - at exit it does not scroll, so the shell prompt displays on the last line of top.

htop - when a program with a short name is printed on a line where a program with a long name was, the remaining letters are displayed.

alpine - the keyboard command lines are not displayed on the bottom two rows, but one row above.

I do not even know if the problems come from line wrapping issues, unhandled escape sequence or a mishandled escape sequence. If anyone has an idea, or a simpler test case,

danik 10-24-2011 04:24 PM

It's awesome! With this terminal the USBNetworking becomes (nearly) redundant! Great work!

dsmid 10-25-2011 02:31 AM

Perfect !
Thanks a lot.

Just a side note: The F-keys on the help screen are zero-based and hexadecimal :)
e.g. F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB

Matan 10-26-2011 09:25 AM

First post updated with revision 5:

More escape sequences (scroll down, origin mode). Now top, htop and alpine appear to work without display glitches.

F numbers in keymap display fixed.

PoP 10-26-2011 10:47 PM

Thanks Matan. I am convinced and I have now switched to original launchpad + your version 5 of myts.

Echoing Dsmid, I miss one feature too. I also always keep forgetting the keyboard mapping and since you have plenty of room to expand, I would like the Menu+Left< recently added help screen, to display in some way, more information.

Completing the help, these additional mappings:
ESC --- Left>
CTRL --- Aa
1 to 0 --- Alt+q to Alt+p
UP, DOWN, LEFT, RIGHT --- Fw_Up, Fw_Down, Fw_Left, Fw_Right
PgUP, PgDown --- Shift+Fw_Up, Shift_Fw_Down
Home, End --- Home, Shift+Home
Back --- left symbol on help screen
Menu --- right symbol on help screen

Applying some corrections:
The F10, F11 and F12 are still displayed as FA, FB, FC on the help screen
The right tab, left tab --- back+z, shift+back+z are not obvious and currently show as an invalid character (white on black question mark) maybe would it be more explicit if depicted as => and <=.

Did I forget any other key modifier sequence?

Thanks anyway. This is a great update.

Matan 10-28-2011 06:09 AM

Another revision. Two main things:

1. Scroll back buffer. See myts.ini for details.

2. Two new escape sequences supported.

Kindlevarazs 10-29-2011 09:02 AM

Could anyone send a screenshot of this emulator?

dpavlin 11-13-2011 12:09 PM

Running on DXG requires keydefs.ini changes
 
Following changes introduced into keydefs.ini before [inkeys-dx] makes this very useful full-screen terminal working on DXG nicely, thanks Matan for your work!

Quote:

; DX - dpavlin
53 = /
90 = Aa
94 = Sym
98 = Home
109 = Left< ; so we can exit!
124 = Left>
91 = Back

;f105 = Left
;f106 = Right
f122 = Up
f123 = Down
f92 = Select

114 = Vol-
115 = Vol+

; DXG doesn't have Left< for exit!
[Settings]
TermEnd = Home
It's important to insert those changes as late as possible in keydefs.ini so they are evaluated last.

Reading man pages will never be same again :-)


All times are GMT -4. The time now is 07:06 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.