Skip to content
🐚 More convenient Emacs shell APIs
Emacs Lisp
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
examples.md
prf-remote-shell.el
prf-shell-command.el
prf-shell.el

README.md

prf-shell

This repository holds several packages:

  • prf-shell-command: Better shell-command API (blog post)
  • prf-shell: Better interactive shell API (blog post)
  • prf-remote-shell: Human-friendly spawning of remote shells

Examples can be found in examples.md.

They rely heavily on package with-shell-interpreter.

prf-remote-shell relies aditionally on helper packages from p3r7/prf-tramp.

Installation

Not yet on Melpa.

For now, the recommended way to install is with use-package, quelpa and quelpa-use-package.

(use-package with-shell-interpreter
  :quelpa (with-shell-interpreter :fetcher github :repo "p3r7/with-shell-interpreter"))

(use-package prf-shell-command
  :quelpa (prf-shell-command :fetcher github :repo "p3r7/prf-shell")
  :after (tramp with-shell-interpreter))

(use-package prf-shell
  :quelpa (prf-shell :fetcher github :repo "p3r7/prf-shell")
  :after (tramp with-shell-interpreter))

And for prf-remote-shell:

(use-package prf-tramp
  :quelpa (prf-tramp :fetcher github :repo "p3r7/prf-tramp"
  :after tramp))
(use-package prf-tramp-friendly-parsing
  :quelpa (prf-tramp-friendly-parsing :fetcher github :repo "p3r7/prf-tramp"))

(use-package prf-remote-shell
  :quelpa (prf-remote-shell :fetcher github :repo "p3r7/prf-shell")
  :after (prf-shell prf-tramp prf-tramp-friendly-parsing))

Functions

Interractive Shells

Command for spawning interactive shells or helper function to create new interactive shell-spawning commands.

  • prf-shell | prf-shell (& :path :interpreter :interpreter-args :command-switch :w32-arg-quote)
  • prf-remote-shell | prf-remote-shell (& :path :interpreter :interpreter-args :command-switch :w32-arg-quote)

Shell Commands

Helpers functions to create commands launching (non-interactive) shell commands.

Interractive Shells

prf-shell (& path interpreter interpreter-args command-switch w32-arg-quote)

Command to spawn a shell at current location (default-directory).

Can also be called as a function with provided arguments, even though we recommend using prf-tramp/shell-cl for this purpose.

prf-remote-shell (& path interpreter interpreter-args command-switch w32-arg-quote)

Same as prf-shell but will prompt for path.

Will parse it expecting it to be a remote path.

Shell Commands

prf-shell-command-to-string (path cmd & interpreter interpreter-args command-switch)

Calls CMD with shell-command-to-string at given PATH.

PATH can be local or remote.

prf-async-shell-command (path cmd & interpreter interpreter-args command-switch)

Calls CMD with async-shell-command at given PATH.

PATH can be local or remote.

Similar projects

Howard Abrams' dot emacs

Howard has a lot of goodies related to remote interactive shells and eshell.

Notably:

  • command eshell-here that behaves like prf-shell called interactively, except spawning eshell instead of shell.
  • command eshell-there that is very similar to prf-remote-shell, except spawning eshell instead of shell
  • various commands for spawning remote shells given host aliases. He also defines a remote-shell-command that behaves like prf-shell-command.

killdash9/better-shell

This package provides command better-shell-for-current-dir which is very similar to prf-shell called interactively. One key difference is that it implements a mechanism for reusing existing shell if appropriate.

It also provides command better-shell-remote-open which behaves like prf-remote-shell except it provides autocompletion from ~/.ssh/known_hosts.

randymorris/tramp-term

Bindings between term.el and TRAMP to ease the creation of remote term buffers.

You can’t perform that action at this time.