3

Similar to this Org-mode-link-to-open-directory-in-dired, however open the link in either:

  • new terminal window (e.g. gnome-terminal, or konsole) or
  • built-in-shell-emulator-inside-emacs-buffer

I often need to run additional shell commands to run calculations or view jupyter notebooks and afaik thits is impossible from dired.

A small workaround is to open the link in dired and run M-x shell (SPC ' in spacemacs), but obviously this requires an additional step I would like to avoid.

3
  • If you just need to run shell commands, would you be open to using babel source blocks? They're re-usable and very flexible -- happy to post an example.
    – Gastove
    Commented May 6, 2016 at 18:17
  • Sure thing! I'd love to learn something new. However most of the commands are ran over ssh on remote machine + so that would only solve part of the issue and I would still prefer classical shell :)
    – redacted
    Commented May 6, 2016 at 18:34
  • Ahhh. Yeah. Babel blocks can be executed over SSH, which is very handy, but they aren't asynchronous -- that is, your entire org session will wind up hanging out, waiting for execution to complete. It does sound like your original idea is considerably better for your use case. Tell me: what are your links like? Do they always point to specific kinds of files? Only a specific set of directories?
    – Gastove
    Commented May 7, 2016 at 17:21

1 Answer 1

0

Windows

Add this to your init file:

(setq org-link-abbrev-alist
      '(("wt" . "shell:wt -p 'PowerShell' -d \"%s\"")))

Then the following link in an org file will open c:\Program Files in Windows Terminal:

[[wt:c:\Program Files]]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.