weechat / weechat

The extensible chat client.
https://weechat.org
GNU General Public License v3.0
2.93k stars 328 forks source link

Do not allow spaces in buffer names #937

Open flashcode opened 7 years ago

flashcode commented 7 years ago

The buffer names (name and full_name) should not contain spaces.

Spaces are causing problems in commands like /buffer and in the relay protocol, where there's a split of arguments on spaces (see https://github.com/ubergeek42/weechat-android/pull/346).

This can be implemented in many ways:

  1. Refuse any space in the name (then the function buffer_new will fail and return NULL if there's a space in name
  2. Replace spaces by another char (like underscore) automatically in buffer_new. The only problem is that there can be a conflict between two different names (for example plugin.test buffer and plugin.test_buffer.

Removing all spaces in buffer names can have an impact on external plugins/scripts.

torhve commented 6 years ago

I think it's a mistake disallowing spaces. In the real world modern chat system, spaces in room names are normal, not rare. WeeChat should strive to support such names going forward rather than making it impossible. In the weechat-matrix client spaces mostly work just fine, but there's some issues that I would categorize as minor, with navigating using /buffer commands etc. Works fine in glowing-bear relay client too.

bendem commented 6 years ago

Would it be wrong to quote names with a space or escape the space with a backslash like shells do?