Watch: spaces in command are not preserved
Author: cptaffeCreated Aug 28, 2025Updated Aug 28, 2025
When invoking Watch with arguments which contain spaces, the arguments are not preserved. For example, this command works as expected in an rc session:
% printf '%s %s %s\n' 1 2 3
1 2 3
But when run through Watch:
Watch printf '%s %s %s\n' 1 2 3
We would expect the argument parsing rc does when invoking Watch to be preserved, however the first string is split again:
To avoid this, Watch will need to quote any arguments with whitespace so that they are parsed correctly by rc again.
Source: 9fans/go