@Override
	public void fieldLocationChanged(FieldLocation location, Field field, EventTrigger trigger) {
		/**
		 * Prevent the user from doing this. Cursor location is controlled by pty. While we've
		 * prevented key strokes from causing this, we've not prevented mouse clicks from doing it.
		 * Next best thing is to just move it back.
		 * 
		 * NOTE: We schedule the cursor re-placement for later, because the FieldPanel may be about
		 * to scroll to the cursor. If we re-place immediately, it will likely scroll to the bottom
		 * of the terminal. This is especially annoying when the user is trying to make a selection.
		 */
		if (trigger == EventTrigger.GUI_ACTION) {
			Swing.runLater(() -> placeCursor(false));
		}
	}
Don't just blow away the selection every key stroke; however, don't allow terminal
changes to modify the selected text without the user knowing. That rule is directly
implemented here. If the selected text changes, destroy the selection.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalPanel.java