Definitely not intended, good catch. I believe the intention was to avoid escaping the space at the end of the completion, which is there to separate it from the next argument rather than being part of the current argument.

I've fixed this using a look ahead, which I don't like doing, but in this case it seems like the simplest approach:

```ruby
arg.gsub(/ (?!$)/, '\ ')
```