Class PasteManager

java.lang.Object
org.aesh.readline.paste.PasteManager

public class PasteManager extends Object
Keep track of edits for paste
Author:
Ståle W. Pedersen
  • Constructor Details

    • PasteManager

      public PasteManager()
      Creates a new PasteManager with an empty paste stack.
  • Method Details

    • setClipboardWriter

      public void setClipboardWriter(Consumer<int[]> clipboardWriter)
      Sets a callback that is invoked whenever text is added to the paste stack. Used to write killed/copied text to the system clipboard via OSC 52.
      Parameters:
      clipboardWriter - the callback to invoke with the added text, or null to disable
    • addText

      public void addText(int[] buffer)
    • get

      public int[] get(int index)
      Retrieves text from the paste stack at the specified index. Index 0 returns the most recently added text.
      Parameters:
      index - the index in the paste stack (0 = most recent)
      Returns:
      the text buffer at the specified index, or the oldest entry if index is out of bounds