简体   繁体   中英

Make executable file run without prompt in linux

Every time I ran an executable installed in the system it's all fine without any prompt, but recently I configured my vim editor to do c++ coding. Every time I build a program using make through vim and want to run the built executable, a pop up shows that this file is an executable and whether I want to execute it??

How do I turn that thing off so that no prompt will annoy me?

edit: The prompt appears only when double clicking the file outside the vim editor. using LXDE desktop on debian.

edit: I noticed that any executable file double clicked in file manager gets the same pop up. when launching the app through the desktop panel it is fine.

I don't know what you did when you "configured vim to do c++", but you should simply be able to build either with a make file by running :make or with g++ directory by calling:

:!g++ % -o %<  # calls gcc filename.ext -o filename

Then in like manner to run the compiled program:

:!./%<         # executes ./filename  (w/o extension) and without prompting

Are you on ubuntu? If so, try open preference of the file, find behavior options, choose execute it when open.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM