Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: insert a partial command into the command line



On Jun 24,  3:24pm, Artem Chuprina wrote:
}
} xterm -e zsh -i -t
} 
} and it will do the most valuable thing of this - allow me to write a
} command with completion and then exit.  But I need to write all the
} command and manually add '&' to detach it.

Put this in your ~/.zshrc file:

    if [[ -o interactive && -o single_command ]]
    then
      print -z "$*"
      function auto-bg {
	BUFFER="{ $BUFFER } &|"
	zle .accept-line
      }
      zle -N accept-line auto-bg
    fi

Now you run zsh like

    xterm -e zsh -s -t -i "ssh some.host.name "

The -s is needed to prevent zsh from treating the argument as the name
of a script file.



Messages sorted by: Reverse Date, Date, Thread, Author