semantic history: allow writing annotations to terminal window
not sure what's the best way to do this, but I'm trying to find a way to annotate where I've clicked to improve workflow with semantic history.
I use semantic history a lot, eg to open a file at a given location (eg file:line:col) from stacktrace or file listing outputs. One problem is that it's hard to remember where you last clicked or where you've already clicked (eg when you need to go over a number of such file locations).
One solution to this would be ability to write annotations to terminal window.
This gets tricky when using tmux which has its own scrollback buffer, but maybe there's a smart way to integrate this with tmux so that annotations are kept in sync with tmux scrolling, eg via tmux hooks which iterm can talk to. For example, one such tmux/iterm hook example I've been using is allowing user to click on a relative file in a tmux pane, and semantic history prepends the correct current directory to resolve to an absolute path, thanks to
set-hook -g pane-focus-in somecmd.
A similar hook could work in this case too, to show annotations in sync with scrollback. In a 1st version, for temporary annotations, we can even not worry about syncing wrt scrollback.
Annotations could be an overlay marker drawn on top of the text, ideally text itself; this would allow for example user to write a plugin that underlines the text that was clicked using semantic history to discover the bounds, followed by entering ascii code for text
(and IIRC this is already implemented internally by iterm2 when user presses command + mouse hover)