Skip to content

tapecanvas/tiny-term

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-term

WIP - a super basic terminal emulator-ish script for norns

screenshot of script running

  • inspiration: "shell" from hid-demo by @okyeron
  • one step closer to making norns my ideal cyber deck

tiny-term is a simple terminal emulator-ish script for norns

  • the script opens with a prompt $ and blinking cursor _

  • input from keyboard displays after the prompt > cd home/we/dust_

  • pressing enter will execute the command.

  • the display will show the executed command and the resulting output

    • pwd -> /home/we/dust/audio
  • the display can be scrolled using e2

  • you can access the history using the up and down arrow keys

  • k2 clears the screen

  • there is currently very basic error handling, and no special key support

  • typical terminal applications will not be able to run ie: text editors, file managers, etc.

    • most of these should throw an error message to prevent execution/prevent crashes, but i'm sure the blocked command list will grow with further testing

features:

  • can run most shell commands that don't require user interaction and don't rely on specific terminal features.
  • some you are able to run:
    • File and directory operations: lspwdcdcpmvrmmkdirrmdir, etc.
    • Text processing: catmorelessheadtailgrepsedawk, etc.
    • System information: dateuptimewhouname, etc.
    • Network operations: pingnetstatcurlwget, etc. (note: if you run ping be sure to set the count flag to one ping -c 1 8.8.8.8 tiny-term can not handle outputs that build upon themselves
    • Process management: pskilltop, etc. (note: top is a terminal-based program, but it can be used in batch mode, which doesn't require a terminal. For example, top -b -n 1 runs top in batch mode and exits after one iteration.)
  • commands that you won't be able to run include terminal-based programs that require user interaction or rely on specific terminal features. Disallowed commands: vi/vimnanolessmorehtop, top (in interactive mode), sshtmux, clear, etc.

to-do:

  • modifier keys
  • custom help response
  • left right arrow key = cursor movement
  • delete key functionality
  • investigate sometimes funky backspace = adds strings??

archive:

  • add command history (up and down keys) - need to rethink movement keys or just use e2 for scroll
  • k2 clear screen
  • up arrow recall last command -- implement real command history next
  • add more disallowed applications
  • handle "TERM environment variable not set." lock-up
  • add textwrap to command input
  • scroll to top of output when command is run
  • scroll to cursor when typing next command (if output is too long to show cursor on first page)
  • work on output formatting
  • working prototype

log:

  • 2024-02-23
    • first draft
    • able to move around through directories, and execute basic commands
    • added prompt display and cursor
  • 2024-02-24
    • scroll to prompt when entering a new command (helps when in a long block of output text)
    • scroll to top of output after command is run (no longer have to scroll to beginning)
    • tried to find a way around getting terminal-based apps (ie: vi, top, less, etc) to work, but options are sliiiim
      • lua has a luaposix library, but not sure if its worth the hassle.
    • screen / format tweaks
  • 2024-02-27
    • added "disallowed_commands" - terminal apps that require a proper terminal environment to work. solved lockup issue when one of these tried to run.
    • worked on cursor positioning - still needs some tweaking though
    • added up arrow to recall last ran command - extend to proper command history next
    • added clear screen key k2
  • 2024-02-28
    • got command history mostly worked out

About

WIP - a super basic terminal emulator-ish script for norns

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages