con-f-use / xontrib-histcpy

Useful aliases and shortcuts for extracting links and text from command output history in xonsh
https://pypi.org/project/xontrib-histcpy/
GNU General Public License v3.0
4 stars 3 forks source link

XONSH_STORE_STDOUT limits #14

Open anki-code opened 4 years ago

anki-code commented 4 years ago

Hi! Thank you for this histcpy!

  1. When XONSH_STORE_STDOUT=True is it has any limits to read output? If I do cat gigabyte_file it saves all gigbyte of data? If yes is it has any other risks?

  2. Is there a way to avoid setting XONSH_STORE_STDOUT to True? For example get only latest output with events/hooks.

Thanks!

anki-code commented 4 years ago

I replaced XONSH_STORE_STDOUT=True to @events.on_postcommand and avoid overhead.

con-f-use commented 4 years ago

Yeah, I think that is a good idea for your output search and should be a fall back or customization for histcopy. I just wanted to have more than the output of the last command and wanted it to produce some output in a freshly started, new terminal. I could achieve the former with a rolling buffer and saving a couple of postcommands into it. I'll definitely think about it.

anki-code commented 4 years ago

The output search xontrib turned out very consistent and universal (I've updated it to 0.3.3). If you want we can think how to bring the histcpy features into it.

For example: