In my XTerm, I want to open new Emacs frame as well as buffer, with working directory set to $PWD in XTerm env.
I tried emacsclient -t -c --eval "(cd $PWD)"
, but it doesn't seem to work.
Is it possible?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityIf you want to create a buffer for a new file ./new-buffer
in the current directory, just call emacsclient
with that filename, like
emacsclient -t ./new-buffer
The option -t
causes emacsclient
to open the buffer in a newly created frame on the current terminal.
If you create a new non-file buffer the default directory for that buffer is the current directory of emacsclient
.
Examples:
emacsclient -t --eval "(eshell t)"
emacsclient -t --eval "(switch-to-buffer (generate-new-buffer \"*new-buffer*\"))"