viddy icon indicating copy to clipboard operation
viddy copied to clipboard

Arguments with spaces in watch command are incorrectly split

Open koterpillar opened this issue 2 years ago • 2 comments

This command gives the tabular output with details:

$ bash -c 'ls -l'
total 0
-rw-r--r--. 1 user user 0 Aug  5 17:23 a
-rw-r--r--. 1 user user 0 Aug  5 17:23 b
-rw-r--r--. 1 user user 0 Aug  5 17:23 c

However, Viddy breaks it, and -l is passed to bash, not ls:

viddy bash -c 'ls -l'

viddy output with just file names

This behavior is present in traditional watch, but I don't actually see a reason for it.

koterpillar avatar Aug 05 '22 07:08 koterpillar

Here the arguments are joined together, which causes the incorrect behavior if some arguments already contain spaces:

https://github.com/sachaos/viddy/blob/0ab3347/snapshot.go#L110

koterpillar avatar Aug 05 '22 09:08 koterpillar

viddy "bash -c 'ls -l'" watch "bash -c 'ls -l'"

phanirithvij avatar Feb 26 '24 04:02 phanirithvij