> From: Jayesh Bhat <jayeshbhat55@gmail.com>
> Date: Sat, 22 Sep 2018 02:53:25 +0200
>
> 3a. Open emacs from Terminal
>
> # open -n /Applications/Emacs.app --args -q
>
> M-x ielm
>
> *** Welcome to IELM *** Type (describe-mode) for help.
> ELISP> (shell-command-to-string "pwd")
> " ]7;file://JayeshMacBook.local/Users/jayesh /Users/jayesh\n"
>
> 3b. Open /Applications/Emacs.app via double click on GUI icon
>
> - M-x ielm
>
> *** Welcome to IELM *** Type (describe-mode) for help.
> ELISP> (shell-command-to-string "pwd")
> "/Users/jayesh\n"
AFAIU, that's how macOS apps behave in terminal and in GUI mode.
Emacs just reflects the truth.
But I'll let macOS experts chime in.