edit-and-execute-command interrupted by SIGTSTPhow to execute more than one command gnome-terminalExecute...

Will Jimmy fall off his platform?

How can select a specific triangle in my Delaunay mesh?

In the Seventh Seal why does Death let the chess game happen?

What is the fundamental difference between catching whales and hunting other animals?

How important is it for multiple POVs to run chronologically?

What is it called when the tritone is added to a minor scale?

Do Goblin tokens count as Goblins?

Can a USB hub be used to access a drive from 2 devices?

Is it acceptable that I plot a time-series figure with years increasing from right to left?

How did שְׁלֹמֹה (shlomo) become Solomon?

What causes a fastener to lock?

Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?

What's the difference between a type and a kind?

What is the maximum amount of diamond in one Minecraft game?

Why did Super-VGA offer the 5:4 1280*1024 resolution?

What is exact meaning of “ich wäre gern”?

Convert integer to full text string duration

How would a sea turtle end up on its back?

Boss furious on bad appraisal

Did Stalin kill all Soviet officers involved in the Winter War?

Who is responsible for exterminating cockroaches in house - tenant or landlord?

What do you call the angle of the direction of an airplane?

What's the difference between 反面 and 一方?

What is the highest level of accuracy in motion control a Victorian society could achieve?



edit-and-execute-command interrupted by SIGTSTP


how to execute more than one command gnome-terminalExecute bash snippets directly in shell?“-bash: 1: command not found” when evaluating >2&1Automatically open text files in editor instead of attempting to run them?Exit status of fc -e is the wrong way aroundControl characters in a terminal with an active foreground processIssue with booleans tests && and || in bashzsh line editor: Can I navigate and edit by argument?Could you explain the following statements on how nonbuiltin commands started by Bash handles signals?Why can't I find anything on this command on the net? `statftime`






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







0















I've been using bash's edit-and-execute-command function:




edit-and-execute-command (C-x C-e)



Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.




https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html



I've noticed that if I invoke an editor,
use Ctrl-Z to put it into the background,
and then use fg to put it back into the foreground,
the shell no longer executes the temporary file.



This is handy if I want to abort the command,
but I found the behavior a little surprising the first time it happened.



My questions:





  • Why does this happen?



    I know from the source code
    that edit_and_execute_command eventually calls fc,
    but it's not immediately clear to me
    why sending SIGTSTP prevents bash from executing the temporary file.



  • If I had accidentally hit Ctrl-Z
    and still wanted to execute the script in the temporary file still open by the editor,
    what would be the best way of doing that?











share|improve this question































    0















    I've been using bash's edit-and-execute-command function:




    edit-and-execute-command (C-x C-e)



    Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.




    https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html



    I've noticed that if I invoke an editor,
    use Ctrl-Z to put it into the background,
    and then use fg to put it back into the foreground,
    the shell no longer executes the temporary file.



    This is handy if I want to abort the command,
    but I found the behavior a little surprising the first time it happened.



    My questions:





    • Why does this happen?



      I know from the source code
      that edit_and_execute_command eventually calls fc,
      but it's not immediately clear to me
      why sending SIGTSTP prevents bash from executing the temporary file.



    • If I had accidentally hit Ctrl-Z
      and still wanted to execute the script in the temporary file still open by the editor,
      what would be the best way of doing that?











    share|improve this question



























      0












      0








      0








      I've been using bash's edit-and-execute-command function:




      edit-and-execute-command (C-x C-e)



      Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.




      https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html



      I've noticed that if I invoke an editor,
      use Ctrl-Z to put it into the background,
      and then use fg to put it back into the foreground,
      the shell no longer executes the temporary file.



      This is handy if I want to abort the command,
      but I found the behavior a little surprising the first time it happened.



      My questions:





      • Why does this happen?



        I know from the source code
        that edit_and_execute_command eventually calls fc,
        but it's not immediately clear to me
        why sending SIGTSTP prevents bash from executing the temporary file.



      • If I had accidentally hit Ctrl-Z
        and still wanted to execute the script in the temporary file still open by the editor,
        what would be the best way of doing that?











      share|improve this question
















      I've been using bash's edit-and-execute-command function:




      edit-and-execute-command (C-x C-e)



      Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.




      https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html



      I've noticed that if I invoke an editor,
      use Ctrl-Z to put it into the background,
      and then use fg to put it back into the foreground,
      the shell no longer executes the temporary file.



      This is handy if I want to abort the command,
      but I found the behavior a little surprising the first time it happened.



      My questions:





      • Why does this happen?



        I know from the source code
        that edit_and_execute_command eventually calls fc,
        but it's not immediately clear to me
        why sending SIGTSTP prevents bash from executing the temporary file.



      • If I had accidentally hit Ctrl-Z
        and still wanted to execute the script in the temporary file still open by the editor,
        what would be the best way of doing that?








      bash signals line-editor fc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 mins ago







      Nathaniel M. Beaver

















      asked 1 hour ago









      Nathaniel M. BeaverNathaniel M. Beaver

      2722 silver badges20 bronze badges




      2722 silver badges20 bronze badges






















          0






          active

          oldest

          votes














          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/3.0/"u003ecc by-sa 3.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%2f528285%2fedit-and-execute-command-interrupted-by-sigtstp%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f528285%2fedit-and-execute-command-interrupted-by-sigtstp%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

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...