Run vsim from dmenu — it only works when directly invoked in the terminalForcing emacs to run with `-nw`...

Diminutive -ula

Another student has been assigned the same MSc thesis as mine (and already defended)

Help in drawing resonance structures in case of polybasic acids

End a command question

Are fuzzy sets appreciated by OR community?

Neural Network vs regression

Would you write key signatures for non-conventional scales?

A food item only made possible by time-freezing storage?

What would influence an alien race to map their planet in a way other than the traditional map of the Earth

New road bike: alloy dual pivot brakes work poorly

Two side-by-side squares are inscribed in a semicircle. The diameter of the semicircle is 16. What is the sum of the two squares' areas?

MaxDetect speed

Why does the leading tone (G#) go to E rather than A in this example?

What does Sartre mean by "pédéraste" - pederast or homosexual?

I cannot take my Macbook Pro 2015 in my Aegean/Lufthansa flight?

Is the order of words purely based on convention?

Why did the Soviet Union not "grant" Inner Mongolia to Mongolia after World War Two?

Youtube not blocked by iptables

What exactly did this mechanic sabotage on the American Airlines 737, and how dangerous was it?

Why was Logo created?

Why does (inf + 0j)*1 evaluate to inf + nanj?

Whaling ship logistics

Reorder a matrix, twice

Do wheelchair-accessible aircraft exist?



Run vsim from dmenu — it only works when directly invoked in the terminal


Forcing emacs to run with `-nw` when called from terminalRun java classfile from terminalterminal logging doesn't complete when I close the terminalhow to make search a text on the terminal directlyUsing globbing/wildcards when Opening Files from TerminalWhy does the terminal echo keystrokes when commands are running?notify-send doesn't work from script but works from terminalScript not working when run in terminalCommand works in script (or -c), but not when ran directly (in an interactive shell)How to properly solve “git-gui: command not found” on Arch Linux?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3
















  • Works: vsim, sh -c vsim

  • Doesn't work: echo "vsim" | sh, echo "vsim" | xargs -I {} sh -c "{}"


I want to run ModelSim (vsim) with dmenu, which is triggered using xbindkeys.





Details



vsim is a executable for ModelSim, installed in /opt/altera/modelsim_ase/bin.



When I run it directly, it runs. But when I run it with xargs (eg. from dmenu), it does not work at all - the script itself launches, but probably in the wrong directory or something, I'm really clueless what's wrong.



My path (I added newlines for clarity):



[ondra@x201 ~]$ echo $PATH
/usr/local/sbin:
/usr/local/bin:
/usr/bin:
/usr/lib/jvm/default/bin:
/usr/bin/site_perl:
/usr/bin/vendor_perl:
/usr/bin/core_perl:
/opt/altera/quartus/bin:
/opt/altera/modelsim_ase/bin:
/home/ondra/bin:
/home/ondra/.gem/ruby/2.1.0/bin:
/opt/altera/University_Program/Monitor_Program/bin/bin


Where is vsim?



[ondra@x201 ~]$ which vsim
/opt/altera/modelsim_ase/bin/vsim


Run it with xargs:



[ondra@x201 ~]$ echo "vsim" |  xargs -I {} sh -c '{} &'
[ondra@x201 ~]$ Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl

# 10.1d

#
# <EOF>
^C


Run it directly:



[ondra@x201 ~]$ vsim
Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# --- and modelsim starts fine now ---


Any ideas welcome.










share|improve this question

















bumped to the homepage by Community 59 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

    – slm
    Nov 18 '14 at 12:07













  • @slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

    – MightyPork
    Nov 18 '14 at 12:15











  • @slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

    – MightyPork
    Nov 18 '14 at 12:20













  • Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

    – slm
    Nov 18 '14 at 12:22













  • @slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

    – MightyPork
    Nov 18 '14 at 12:25


















3
















  • Works: vsim, sh -c vsim

  • Doesn't work: echo "vsim" | sh, echo "vsim" | xargs -I {} sh -c "{}"


I want to run ModelSim (vsim) with dmenu, which is triggered using xbindkeys.





Details



vsim is a executable for ModelSim, installed in /opt/altera/modelsim_ase/bin.



When I run it directly, it runs. But when I run it with xargs (eg. from dmenu), it does not work at all - the script itself launches, but probably in the wrong directory or something, I'm really clueless what's wrong.



My path (I added newlines for clarity):



[ondra@x201 ~]$ echo $PATH
/usr/local/sbin:
/usr/local/bin:
/usr/bin:
/usr/lib/jvm/default/bin:
/usr/bin/site_perl:
/usr/bin/vendor_perl:
/usr/bin/core_perl:
/opt/altera/quartus/bin:
/opt/altera/modelsim_ase/bin:
/home/ondra/bin:
/home/ondra/.gem/ruby/2.1.0/bin:
/opt/altera/University_Program/Monitor_Program/bin/bin


Where is vsim?



[ondra@x201 ~]$ which vsim
/opt/altera/modelsim_ase/bin/vsim


Run it with xargs:



[ondra@x201 ~]$ echo "vsim" |  xargs -I {} sh -c '{} &'
[ondra@x201 ~]$ Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl

# 10.1d

#
# <EOF>
^C


Run it directly:



[ondra@x201 ~]$ vsim
Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# --- and modelsim starts fine now ---


Any ideas welcome.










share|improve this question

















bumped to the homepage by Community 59 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

    – slm
    Nov 18 '14 at 12:07













  • @slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

    – MightyPork
    Nov 18 '14 at 12:15











  • @slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

    – MightyPork
    Nov 18 '14 at 12:20













  • Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

    – slm
    Nov 18 '14 at 12:22













  • @slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

    – MightyPork
    Nov 18 '14 at 12:25














3












3








3









  • Works: vsim, sh -c vsim

  • Doesn't work: echo "vsim" | sh, echo "vsim" | xargs -I {} sh -c "{}"


I want to run ModelSim (vsim) with dmenu, which is triggered using xbindkeys.





Details



vsim is a executable for ModelSim, installed in /opt/altera/modelsim_ase/bin.



When I run it directly, it runs. But when I run it with xargs (eg. from dmenu), it does not work at all - the script itself launches, but probably in the wrong directory or something, I'm really clueless what's wrong.



My path (I added newlines for clarity):



[ondra@x201 ~]$ echo $PATH
/usr/local/sbin:
/usr/local/bin:
/usr/bin:
/usr/lib/jvm/default/bin:
/usr/bin/site_perl:
/usr/bin/vendor_perl:
/usr/bin/core_perl:
/opt/altera/quartus/bin:
/opt/altera/modelsim_ase/bin:
/home/ondra/bin:
/home/ondra/.gem/ruby/2.1.0/bin:
/opt/altera/University_Program/Monitor_Program/bin/bin


Where is vsim?



[ondra@x201 ~]$ which vsim
/opt/altera/modelsim_ase/bin/vsim


Run it with xargs:



[ondra@x201 ~]$ echo "vsim" |  xargs -I {} sh -c '{} &'
[ondra@x201 ~]$ Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl

# 10.1d

#
# <EOF>
^C


Run it directly:



[ondra@x201 ~]$ vsim
Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# --- and modelsim starts fine now ---


Any ideas welcome.










share|improve this question

















  • Works: vsim, sh -c vsim

  • Doesn't work: echo "vsim" | sh, echo "vsim" | xargs -I {} sh -c "{}"


I want to run ModelSim (vsim) with dmenu, which is triggered using xbindkeys.





Details



vsim is a executable for ModelSim, installed in /opt/altera/modelsim_ase/bin.



When I run it directly, it runs. But when I run it with xargs (eg. from dmenu), it does not work at all - the script itself launches, but probably in the wrong directory or something, I'm really clueless what's wrong.



My path (I added newlines for clarity):



[ondra@x201 ~]$ echo $PATH
/usr/local/sbin:
/usr/local/bin:
/usr/bin:
/usr/lib/jvm/default/bin:
/usr/bin/site_perl:
/usr/bin/vendor_perl:
/usr/bin/core_perl:
/opt/altera/quartus/bin:
/opt/altera/modelsim_ase/bin:
/home/ondra/bin:
/home/ondra/.gem/ruby/2.1.0/bin:
/opt/altera/University_Program/Monitor_Program/bin/bin


Where is vsim?



[ondra@x201 ~]$ which vsim
/opt/altera/modelsim_ase/bin/vsim


Run it with xargs:



[ondra@x201 ~]$ echo "vsim" |  xargs -I {} sh -c '{} &'
[ondra@x201 ~]$ Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl

# 10.1d

#
# <EOF>
^C


Run it directly:



[ondra@x201 ~]$ vsim
Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# --- and modelsim starts fine now ---


Any ideas welcome.







shell command-line terminal stdin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '14 at 2:38









Gilles

576k140 gold badges1188 silver badges1702 bronze badges




576k140 gold badges1188 silver badges1702 bronze badges










asked Nov 18 '14 at 10:12









MightyPorkMightyPork

7667 silver badges21 bronze badges




7667 silver badges21 bronze badges






bumped to the homepage by Community 59 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









bumped to the homepage by Community 59 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 59 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

    – slm
    Nov 18 '14 at 12:07













  • @slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

    – MightyPork
    Nov 18 '14 at 12:15











  • @slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

    – MightyPork
    Nov 18 '14 at 12:20













  • Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

    – slm
    Nov 18 '14 at 12:22













  • @slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

    – MightyPork
    Nov 18 '14 at 12:25



















  • You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

    – slm
    Nov 18 '14 at 12:07













  • @slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

    – MightyPork
    Nov 18 '14 at 12:15











  • @slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

    – MightyPork
    Nov 18 '14 at 12:20













  • Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

    – slm
    Nov 18 '14 at 12:22













  • @slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

    – MightyPork
    Nov 18 '14 at 12:25

















You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

– slm
Nov 18 '14 at 12:07







You cannot run vsim in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find where vsim is located on disk like so: type -f vsim. This feels like an XY Problem, what are you ultimately trying to do with vsim. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.

– slm
Nov 18 '14 at 12:07















@slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

– MightyPork
Nov 18 '14 at 12:15





@slm I have a dmenu-based launcher, and want to be able to run ModelSim with it. What'd you suggest? I'm not too excited with xterm floating around my workspace if I will never look at the outputs there (modelsim shows the errors in it's internal log window).

– MightyPork
Nov 18 '14 at 12:15













@slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

– MightyPork
Nov 18 '14 at 12:20







@slm output of type -f vsim is vsim is /opt/altera/modelsim_ase/bin/vsim. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do ./vsim. If there's another way, please share.

– MightyPork
Nov 18 '14 at 12:20















Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

– slm
Nov 18 '14 at 12:22







Can you not run vsim from any directory? The directory that includes vsim is in your $PATH.

– slm
Nov 18 '14 at 12:22















@slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

– MightyPork
Nov 18 '14 at 12:25





@slm Indeed, I can. The problem is, it does not work with the xargs thing. This works: sh -c "vsim", this does not: echo "vsim" | xargs -I {} sh -c "{}". So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.

– MightyPork
Nov 18 '14 at 12:25










1 Answer
1






active

oldest

votes


















0
















From your experiments, it appears that the vsim program wants its standard input to be connected to a terminal; if it isn't, it either does nothing useful (because it's waiting for input but not getting any) or exits.




$ vsim
$ sh -c vsim



This runs the command normally from a terminal, in the foreground. The command can read input from the terminal.




$ echo "vsim" | sh
$ echo "vsim" | xargs -I {} sh -c "{}"



In both cases, the standard input of vsim is connected to the pipe from the echo command. The vsim command will see a pipe as its input and not a terminal, if it cares. And it will see the end of the file.




$ echo "vsim" |  xargs -I {} sh -c '{} &'



Here, not only is vsim's input connected to the pipe, but the process is executed in the background, so it can't read from the terminal at all (if it tries to, it'll be suspended until it gets foregrounded).



If you want to run vsim inside a pipeline where its standard input would not be connected to the terminal, redirect the input from the terminal to it.



echo "vsim </dev/tty" | sh


If you want to run the program from dmenu, you'll presumably have to open it in a new terminal emulator. Invoke xterm -e vsim instead of vsim.



I'm not familiar with vsim; it's quite possible that there are other ways of running it.






share|improve this answer




























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });















    draft saved

    draft discarded
















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f168619%2frun-vsim-from-dmenu-it-only-works-when-directly-invoked-in-the-terminal%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0
















    From your experiments, it appears that the vsim program wants its standard input to be connected to a terminal; if it isn't, it either does nothing useful (because it's waiting for input but not getting any) or exits.




    $ vsim
    $ sh -c vsim



    This runs the command normally from a terminal, in the foreground. The command can read input from the terminal.




    $ echo "vsim" | sh
    $ echo "vsim" | xargs -I {} sh -c "{}"



    In both cases, the standard input of vsim is connected to the pipe from the echo command. The vsim command will see a pipe as its input and not a terminal, if it cares. And it will see the end of the file.




    $ echo "vsim" |  xargs -I {} sh -c '{} &'



    Here, not only is vsim's input connected to the pipe, but the process is executed in the background, so it can't read from the terminal at all (if it tries to, it'll be suspended until it gets foregrounded).



    If you want to run vsim inside a pipeline where its standard input would not be connected to the terminal, redirect the input from the terminal to it.



    echo "vsim </dev/tty" | sh


    If you want to run the program from dmenu, you'll presumably have to open it in a new terminal emulator. Invoke xterm -e vsim instead of vsim.



    I'm not familiar with vsim; it's quite possible that there are other ways of running it.






    share|improve this answer






























      0
















      From your experiments, it appears that the vsim program wants its standard input to be connected to a terminal; if it isn't, it either does nothing useful (because it's waiting for input but not getting any) or exits.




      $ vsim
      $ sh -c vsim



      This runs the command normally from a terminal, in the foreground. The command can read input from the terminal.




      $ echo "vsim" | sh
      $ echo "vsim" | xargs -I {} sh -c "{}"



      In both cases, the standard input of vsim is connected to the pipe from the echo command. The vsim command will see a pipe as its input and not a terminal, if it cares. And it will see the end of the file.




      $ echo "vsim" |  xargs -I {} sh -c '{} &'



      Here, not only is vsim's input connected to the pipe, but the process is executed in the background, so it can't read from the terminal at all (if it tries to, it'll be suspended until it gets foregrounded).



      If you want to run vsim inside a pipeline where its standard input would not be connected to the terminal, redirect the input from the terminal to it.



      echo "vsim </dev/tty" | sh


      If you want to run the program from dmenu, you'll presumably have to open it in a new terminal emulator. Invoke xterm -e vsim instead of vsim.



      I'm not familiar with vsim; it's quite possible that there are other ways of running it.






      share|improve this answer




























        0














        0










        0









        From your experiments, it appears that the vsim program wants its standard input to be connected to a terminal; if it isn't, it either does nothing useful (because it's waiting for input but not getting any) or exits.




        $ vsim
        $ sh -c vsim



        This runs the command normally from a terminal, in the foreground. The command can read input from the terminal.




        $ echo "vsim" | sh
        $ echo "vsim" | xargs -I {} sh -c "{}"



        In both cases, the standard input of vsim is connected to the pipe from the echo command. The vsim command will see a pipe as its input and not a terminal, if it cares. And it will see the end of the file.




        $ echo "vsim" |  xargs -I {} sh -c '{} &'



        Here, not only is vsim's input connected to the pipe, but the process is executed in the background, so it can't read from the terminal at all (if it tries to, it'll be suspended until it gets foregrounded).



        If you want to run vsim inside a pipeline where its standard input would not be connected to the terminal, redirect the input from the terminal to it.



        echo "vsim </dev/tty" | sh


        If you want to run the program from dmenu, you'll presumably have to open it in a new terminal emulator. Invoke xterm -e vsim instead of vsim.



        I'm not familiar with vsim; it's quite possible that there are other ways of running it.






        share|improve this answer













        From your experiments, it appears that the vsim program wants its standard input to be connected to a terminal; if it isn't, it either does nothing useful (because it's waiting for input but not getting any) or exits.




        $ vsim
        $ sh -c vsim



        This runs the command normally from a terminal, in the foreground. The command can read input from the terminal.




        $ echo "vsim" | sh
        $ echo "vsim" | xargs -I {} sh -c "{}"



        In both cases, the standard input of vsim is connected to the pipe from the echo command. The vsim command will see a pipe as its input and not a terminal, if it cares. And it will see the end of the file.




        $ echo "vsim" |  xargs -I {} sh -c '{} &'



        Here, not only is vsim's input connected to the pipe, but the process is executed in the background, so it can't read from the terminal at all (if it tries to, it'll be suspended until it gets foregrounded).



        If you want to run vsim inside a pipeline where its standard input would not be connected to the terminal, redirect the input from the terminal to it.



        echo "vsim </dev/tty" | sh


        If you want to run the program from dmenu, you'll presumably have to open it in a new terminal emulator. Invoke xterm -e vsim instead of vsim.



        I'm not familiar with vsim; it's quite possible that there are other ways of running it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '14 at 2:37









        GillesGilles

        576k140 gold badges1188 silver badges1702 bronze badges




        576k140 gold badges1188 silver badges1702 bronze badges


































            draft saved

            draft discarded



















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f168619%2frun-vsim-from-dmenu-it-only-works-when-directly-invoked-in-the-terminal%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...