jredfox / OpenTerminal

do you have a java command prompt program? then this program is for you
4 stars 0 forks source link

Add JML Console #49

Closed jredfox closed 1 year ago

jredfox commented 2 years ago

Notice: these features were solely inspired by classic terminals such as command prompt, terminal.app(macOs), and linux terminals. Also inspired by the minecraft launcher's console. They are not a copy of them nor contains any code from them. I also ignore features that are bugged or I don't like and modified the protocols to how I see is fit(the proper way)

buffer size is current screen the rest is fetched from an offline temporarily file or the log file if provided and the index should be long drag and drop to console files and then it prints the paths in quotes like terminals do ANSI escape color codes and format to change text Supports logging libraries as well as error streams colorized text based on the profile supports filtering the screen based on logging levels and a search bar if enabled. clearing the screen BUTTON clears all text from the console sets the start index to the end of the file clearing ANSI escape codes clearing will be supported but it wont be called when setting the bg from ansi colors nor will it actually delete any data from the log file new ANSI escape code ESC[38/48;0;<int>m #RGBA as the int NOTICE the 0 is required to be RGBA otherwise it will use defaults new ANSI escape code ESC[F;<name>;<int size>m font code new ANSI escape code ESC[profile;<uuid>m changes the profile given the uuid new ANSI escape code ESC[log;<LEVEL>m 0=get color no params new ANSI escape code ESC[log;1;<LEVEL>;0/2/5;<int RGBA>m set the level's current rgb to override the profiles. new ANSI escape code ESC[-1m reset bg, fg and title back to the current profile's settings supports ANSI escape code to change the title with colors. by simply formatting the colors in the title string \033]0;38;5;43A Cyan Title\007. supports any ANSI ESC sequence for colors or formatting and clearing of the formatting. also supports hotloading multiple escape sequence codes in one call like ESC[3;4;53;38;2;0;0;0;48;2;255;255;255m as an example. after the color arg the next 4 params are actually for the colors the rest continue on as normal. when setting the title these sequences get ignored till the \007 gets found

changes to AnsiColors

ANSI ESC:

keybinds:

right click: bring up a menu to copy, copy all, paste as a UI

Profile:
{
  uuid:""
  name:"" #the human readable name of the profile do not use to change the profile as it can contain conflicts
  bg:RGBA #background color
  fg:RGBA #text color
  fgLevelError:RGBA #the error color overrides esc codes???
  fgLevelWarn:RGBA #the warning color overrides esc codes???
  fg<LEVEL>:RGBA #Supports custom levels
  bgImage:<path/to/image.png> #if this is nonnull bg will be ignored. using escape codes the image will render if the bg of the color uses alpha
  icon:<path/to/icon.png>
  fontName:""
  fontSize:<int>
}

API events for programmers: tabbing key pressed

Modes:

Arguments:

jredfox commented 1 year ago

This issue will be it's own library for JML and the native CLI will be for OpenTerminal only