How can I launch emacsclient maximized from the commandline

4.1k views Asked by At

I am wonder how to start emacsclient in a new maximized frame.

emacsclient -c 

starts a new frame but the man page indicated no way to maximize this frame. There are no such options as --maximized.

Warning : this is no a duplicate from the post : How do I provide a command-line option to emacsclient?. Indeed, the answers of this post don't fix my issue. They use the -F option which seems to be documented on the man for them but which is not present in my man emacsclient (in debian sid) and the -F option does not work in my case :

$ emacsclient -c  -F "((fullscreen . maximized))"
     emacsclient: unrecognized option '-F'
     Try `emacsclient --help' for more information

Here is the result of emacsclient --help for information :

emacsclient --help
Usage: emacsclient [OPTIONS] FILE...
Tell the Emacs server to visit the specified files.
Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.

The following OPTIONS are accepted:
-V, --version           Just print version info and return
-H, --help              Print this usage information message
-nw, -t, --tty          Open a new Emacs frame on the current terminal
-c, --create-frame      Create a new frame instead of trying to
                        use the current Emacs frame
-e, --eval              Evaluate the FILE arguments as ELisp expressions
-n, --no-wait           Don't wait for the server to return
-d DISPLAY, --display=DISPLAY
                        Visit the file in the given display
-s SOCKET, --socket-name=SOCKET
                        Set filename of the UNIX socket for communication
-f SERVER, --server-file=SERVER
                        Set filename of the TCP authentication file
-a EDITOR, --alternate-editor=EDITOR
                        Editor to fallback to if the server is not running
                        If EDITOR is the empty string, start Emacs in daemon
                        mode and try connecting again

Report bugs with M-x report-emacs-bug.
3

There are 3 answers

1
ppr On BEST ANSWER
(add-to-list 'default-frame-alist '(fullscreen . fullboth)) 

in .emacs does the job.

5
Evgeny Lukianchikov On

You can try using ‘-F alist’ or ‘--frame-parameters=alist’ option.

alist format is described here

You can select width, height and font so that you'll have comfortable window size.

0
user178047 On

Here's a minimal working example from Evgeny's answer

  emacsclient -c -F "'(fullscreen . fullboth)"

  emacsclient -c -F "'(fullscreen . maximized)"

  alias ecx="emacsclient -c -F \"'(fullscreen . maximized)\""

  emacsclient -c -F "((width . 100) (height . 100) (left . 400))"