Class TuiClient

java.lang.Object
net.vincent.communidirect.client.tui.TuiClient

public class TuiClient extends Object
Full Lanterna TUI for CommuniDirect Client.

Key bindings

   Ctrl+N  Open external editor to compose a new message
   Ctrl+S  Browse staged messages
   Ctrl+V  Browse received messages
   Ctrl+X  Exit
   ↑/↓     Navigate lists
   Ctrl+O  Send selected staged message (staged view only)
   Enter   Open selected message (received view only)
   Esc     Back to log / dismiss overlay
 
  • Constructor Details

    • TuiClient

      public TuiClient(SettingsManager settings, KeyStoreManager keyStore)
      Constructs a TuiClient and derives the compact local identity string from the public key held in keyStore.
      Parameters:
      settings - the loaded application settings (IP, port)
      keyStore - the loaded key store providing the local private key and peer keys
  • Method Details

    • run

      public void run() throws IOException
      Starts the interactive TUI, blocking until the user exits with Ctrl+X or the application is interrupted.

      This method:

      1. Creates required data directories.
      2. Performs an initial directory scan.
      3. Initialises the Lanterna Screen.
      4. Schedules a 60-second auto-refresh of received messages.
      5. Enters the poll-based event loop.
      Throws:
      IOException - if Lanterna cannot initialise the terminal