The ncurses-launch launcher: Fix ncurses applications in the snap runtime

This launcher fixes certain errors that can occur with ncurses applications, including, but not limited to, the following error message:

Error opening terminal: xterm-256color.

How to use

  1. Merge the following part definition into your Snapcraft recipe:

    parts:
      # The ncurses-launch launcher: Fix ncurses applications in the snap runtime - doc - snapcraft.io
      # https://forum.snapcraft.io/t/the-ncurses-launch-launcher-fix-ncurses-applications-in-the-snap-runtime/10444
      ncurses-launch:
        source: https://github.com/brlin-tw/ncurses-launch.git
        source-tag: v1.0.0
        stage-packages:
          - ncurses-base
        plugin: dump
    
  2. In the apps stanza, insert bin/ncurses-launch into the command chain:

    apps:
      _app_name_:
        # The command to run the application, the value should be a *relative path* to an executable file rooted from the `prime` directory
        command: bin/ncurses-launch "${SNAP}"/bin/_app_command_
    

    if you’re using the full adapter:

    apps:
      _app_name_:
        # The environment adapter style to use, `command-chain` is only supported
        adapter: full
    
        # The command to run the application, the value should be a *relative path* to an executable file rooted from the `prime` directory
        command: bin/_app_command_
        command-chain:
        - bin/ncurses-launch
    

The implementation

Snaps that use this stage snap


Happy snapcrafting!