Skip to content

Getting Started

maxlandon edited this page Jan 2, 2023 · 7 revisions

The following snippet shows how to create a new console instance with the following defaults:

  • A default readline keymap configuration (Emacs mode).
  • A default -main- menu, with an empty command tree.
  • Bound to this menu, an in-memory history source.
  • Also bound, an [oh-my-posh prompt engine] with its default configuration loaded.
package main

func main() {
	// Instantiate a new app, with a single, default menu.
	// All defaults are set, and nothing is needed to make it work
	app := console.New()
        
    // ... We will include code in here as we go through the documentation...
        
    // And will run the console application
    app.Run()
}

Short but enough, we can now configure the underlying readline shell behavior.

Clone this wiki locally