I'm using Finnish keyboard layout which maps AltGr+Space to non-breaking space (NBSP, U+00A0). I'm happy with this in general but I find that I often accidentally write NBSP instead of normal space after pipe "|" symbol (written with AltGr+< with Finnish keyboard layout) while using bash command line. I guess this is caused by the fact that I need to hold AltGr while typing the pipe and release it before hitting space. And when I have bad timing for the release of AltGr I end up with invisible typo on the command line and error messages such as
grep: command not found
which looks pretty similar to
grep: command not found
which makes this issue a bit hard to notice on the first time.
I know that I can disable NBSP but I would prefer disabling it (having AltGr+Space to produce regular space) only after pipe character, or if that's not possible, always on the bash command line or readline level. Is there any simple way to do this without modifying source code of bash, readline or my terminal emulator (gnome-terminal)?
Another good solution would be to configure NBSP to be somehow visible on the command line, e.g. replaced with another character (say U+2423 ␣) for rendering only.