Skip to content

Instantly share code, notes, and snippets.

@jbadger3
Created September 9, 2022 17:58
Show Gist options
  • Save jbadger3/1e3fa6bba39b570d2e3bf108f18cba19 to your computer and use it in GitHub Desktop.
Save jbadger3/1e3fa6bba39b570d2e3bf108f18cba19 to your computer and use it in GitHub Desktop.
on_command_line_applications_in_swift
import Foundation
import Terminus
let terminal = Terminal.shared
terminal.clearScreen()
terminal.cursor.moveToHome()
let palette = XTermPalette()
let itemColor = palette.Aquamarine2
let selectionColor = palette.Green5
let menuItems = ["Life", "Death", "Taxes"]
let menu = Menu(items: menuItems, maxColumns: 1, scrollDirection: .vertical, itemAttributes: [.color(itemColor)], selectionAttributes: [.reverse, .color(selectionColor)])
let selection = menu.getSelection()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment