Coder Social home page Coder Social logo

termconfig's Introduction

termconfig

Cross-platform terminal helper library in Racket

This library currently supports unix and windows. Mac OS is supported implicitly via posix compatibility. Explicit testing is done one Ubuntu and development is done on Windows and WSL.

Exported functions

  • (enable-raw) - Platform specifically enables raw (aka non-canonical) mode.
  • (disable-raw) - Platform specifically disables raw mode. This currently needs to be called after enable-raw to restore the saved terminal state.
  • (with-raw expr*) - evaluates the exprs in the context of raw mode (recommended approach).
  • (move-cursor-x x), (move-cursor-y y), and (move-cursor x y) move the cursor relatively by x, y, or x and y respectively.
  • (set-cursor x y) sets the cursor position to the x column and y row.
  • (show-cursor) and (hide-cursor) show and hide the cursor respectively.
  • (set-color-style #:fg-style fg-{color} #:bg-style bg-{color}) sets the color style for the terminal going forward. The foreground and background are optional keywords and colors are exported as fg-color, bg-color, fg-bright-color, and bg-bright-color.
  • (clear-screen) clears the screen.

Roadmap

To see more information, go to the issues and projects tabs in the GitHub repository as well as the current statuses.

  • Raw mode
  • Cursor movement
  • Clear the terminal or a single cell
  • Foreground and background colors
  • Retrieve input in raw mode (see next item)
  • Callbacks or polling for input?
  • Resize and cursor movement events
  • Better documentation
  • Better testing, including platform specific testing

termconfig's People

Contributors

dodgez avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

termconfig's Issues

Add a function to clear the screen and individual character cells

Currently the library does not expose helper functions to clear the terminal entirely nor an individual cell. This should be as easy as sending the appropriate ANSI escape codes.

One nuance would be if the Windows terminal is not setup for virtual codes. This may be able to be fixed by forcefully setting that flag when the library is loaded.

Add cursor movement code

Currently the library does not expose helper functions to move a cursor in the terminal. This should be as easy as sending the appropriate ANSI escape codes.

One nuance would be if the Windows terminal is not setup for virtual codes. This may be able to be fixed by forcefully setting that flag when the library is loaded.

Add foreground and background color functions

Currently the library does not expose helper functions to set the current character color scheme in the terminal. This should be as easy as sending the appropriate ANSI escape codes.

One nuance would be if the Windows terminal is not setup for virtual codes. This may be able to be fixed by forcefully setting that flag when the library is loaded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.