If you're going the Python + `ps` route, then this should be better and more efficient:

    :pyx import os, subprocess
    :let vim_cmdline = pyxeval("subprocess.check_output(['ps', '-p', str(os.getpid()), '-o', 'cmd='])")

Note that you're checking for the current PID (`os.getpid()`), since the Python interpreter is running *inside* the current Vim process.

One (definitely Linux-only!) method that doesn't involve Python *or* `ps` is to read from the `/proc` filesystem directly. It turns out `/proc/self` has information about the current process, and the `cmdline` file has the command line (separated with NUL bytes.)

You can get the current command-line in a Vim list with:

    let vim_cmdline = split(readfile('/proc/self/cmdline')[0], '\n', 1)

It's not 100% perfect. If you have arguments with a newline in them, then this expression wil discard them (they'd be indices `[1]`, `[2]`, etc. in the list), but it's probably good enough for most purposes, since arguments with newlines are typically quite rare.