I use this code
;; Set my-projectile-project-name to projectile-project-name,
;; so that later I can also set projectile project name when in *Messages* buffer etc
(defun my-projectile-switch-project-action ()
(set-frame-parameter nil 'my-projectile-project-name projectile-project-name)
(setq projectile-switch-project-action 'my-projectile-switch-project-action)
(let ((project-name (projectile-project-name)))
(if (not (string= "-" project-name))
(format " in [%s]" project-name)
(format " in [%s]" (frame-parameter nil 'my-projectile-project-name)))))))
I've previously used https://github.com/john2x/nameframe.
It will switch to projectile project frame if there is already opened such.
It sets persistent projectile project name in frame title, but its format is not customizable and there appears separate window with
*Messages*. And if you close it, all emacs frames are closed.