2

How to disable this pop-up warning for orgmode commands such as:

shell:ls *.org

For which I would wish just to click once? Thanks!

Adelita
  • 155
  • 7

1 Answers1

2

(setq org-confirm-shell-link-function nil)

But:

Shell links can be dangerous: just think about a link

[[shell:rm -rf ~/*][Google Search]]

This link would show up in your Org document as "Google Search", but really it would remove your entire home directory. Therefore we advise against setting this variable to nil. Just change it to ‘y-or-n-p’ if you want to confirm with a single keystroke rather than having to type "yes".

Cf. C-h f org-confirm-shell-link-function

See also org-link-shell-skip-confirm-regexp. You can allow specific commands through it. But beware of the possibility of a command like ls *.org && rm -rf ~/*: ^ls.* is obviously not enough.

Firmin Martin
  • 1,265
  • 7
  • 23
  • 1
    Very useful and nice explanation. – Adelita Jul 23 '21 at 12:14
  • However, those links do not run independent from clicking. So one must still click. Is there the option to avoid the warning per buffer? – Adelita Jul 23 '21 at 13:55
  • @Adelita I'm not sure what do you mean by running links independently. Do you want to run all shell links on the buffer ? Or one link, but asynchronously ? Or maybe both ? BTW, you can also press `C-c C-o` on the link instead of clicking at it. For the latter question, you can set `org-confirm-shell-link-function` locally so that it works per buffer. Cf. [this question](https://stackoverflow.com/a/44021603/8274517) to do so. – Firmin Martin Jul 23 '21 at 15:58
  • Thanks, I think that's what I was looking for. – Adelita Jul 23 '21 at 17:46