Fixing that means using something more complicated than the old method and that's a bit of a pain in psql, but that doesn't mean we should tell people that the old method is an acceptable approach.
+1
Frankly, I don't find doing backups with psql this way interesting. I'm a bit astonished that anyone's doing it, really. Most of the time I'm doing anything more complicated than pg_basebackup I've got more flexible tools at hand than psql too.
\gset should be a workaround for anyone who really wants to do this in psql for some reason.