Thanks. Actually, I found a workaround: I do a "set sqlprompt &variable" first, then a "set prompt [connection]" in my login.sql script.
In SQL*Plus, the first command works, but the second one does nothing.
In PL/SQL Developer, the first command replaces the SQL prompt by a variable name instead of its value, but the second command works.