private boolean appendString(CharSequence message, AttributeSet attributeSet) {

		// cap message size before update
		if (message.length() > maximumCharacterLimit) {
			int delta = message.length() - maximumCharacterLimit;
			message = message.subSequence(delta, message.length());
		}

		try {
			Document document = getDocument();
			int overage = document.getLength() + message.length() - maximumCharacterLimit;
			if (overage <= 0) {
				document.insertString(document.getLength(), message.toString(), attributeSet);
				return false;
			}

			// trim the excess text that will result when inserting the new message
			int truncationAmount = (int) (maximumCharacterLimit * truncationFactor);
			int docToTrim = Math.min(overage + truncationAmount, document.getLength());
			int caretPos = getCaretPosition();
			document.remove(0, docToTrim);
			document.insertString(document.getLength(), message.toString(), attributeSet);
			return caretPos < docToTrim;
		}
		catch (BadLocationException e) {
			Msg.debug(this, "Unexpected exception updating text", e);
			return false;
		}
	}
% of characters to delete when truncation is necessary
Ghidra/Features/Base/src/main/java/ghidra/framework/main/ConsoleTextPane.java