snoopy icon indicating copy to clipboard operation
snoopy copied to clipboard

How to get only user typing commands

Open youjeongsue opened this issue 1 year ago • 3 comments

Checklist before starting to submit this support request

I confirm that:

  • [X] I am requesting support! :)
  • [x] I have tested this with the latest stable Snoopy version (or the latest master build).
  • [x] I have checked the FAQ.
  • [x] I have read Snoopy's documentation here and here.
  • [x] I have searched Snoopy issues for an existing issue that matches my problem, and found none.

Issue description

Hi, Snoopy team! I have simple question. How can I get only user typing commands for result. I have searched Snoopy docs like filter feature but cannot find the way. Any comments will very helpful for me!!

Issue reproduction steps

Expected result

<FILLIN>

Actual result

<FILLIN>

youjeongsue avatar Dec 08 '23 05:12 youjeongsue

Hey @youjeongsue.

I think what you're looking for is the only_tty filter.

The comments in the config file maybe really aren't the best in this regard (feel free to open a PR with improvements): https://github.com/a2o/snoopy/blob/master/etc/snoopy.ini.in#L81

In short, configure Snoopy filtering as follows:

filter_chain = only_tty

This should do the trick. Can you report back if it works as expected?

bostjan avatar Dec 08 '23 14:12 bostjan

This filter will only work when commands are run with sudo...it won't work when the user runs their normal commands.

sudo ls ---> logged
ls ---> not work

Is there a way to save normal commands as well?

hatamiarash7 avatar Jan 24 '24 08:01 hatamiarash7