<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="pref-custom-exit" lang="zh_CN">

  <info>
    <revision pkgversion="3.8" date="2013-03-02" status="candidate"/>
    <revision pkgversion="3.12" date="2014-09-08" status="candidate"/>
    <revision pkgversion="3.34" date="2020-01-04" status="candidate"/>
    <link type="guide" xref="index#preferences"/>
    <link type="guide" xref="pref#profile"/>
<!--    <link type="seealso" xref="prob-recover-default-profile"/>-->

    <credit type="author copyright">
      <name>Sindhu S</name>
      <email>sindhus@live.in</email>
      <years>2013</years>
    </credit>
    <credit type="copyright editor">
      <name>Ekaterina Gerasimova</name>
      <email>kittykat3756@gmail.com</email>
      <years>2013-2014</years>
    </credit>
    <credit type="copyright editor">
      <name>Michael Hill</name>
      <email>mdhillca@gmail.com</email>
      <years>2013</years>
    </credit>

    <license xmlns="http://projectmallard.org/1.0/">

  <p>This work is licensed under a
  <link href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
  Attribution-Share Alike 3.0 Unported License</link> and a
  <link href="http://www.gnu.org/licenses/">GNU General Public License version
  3</link>. It may be redistributed and/or modified under either license.</p>

  <p>GPL 3 statement:</p>
  <p>This work is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3 as
  published by the Free Software Foundation.</p>

  <p>This work is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.</p>

  <p>You should have received a copy of the GNU General Public License
  along with this program. If not, see http://www.gnu.org/licenses/.</p>
</license>

    <desc>Set the behavior of <app>Terminal</app> when a custom command or the default shell exits.</desc>

  </info>

  <title>Set behavior on command exit</title>

  <p>You can set the terminal to exit, restart or remain open when the shell or
  a custom command exits:</p>

  <steps>
    <item>
      <p>Press the menu button in the top-right corner of the window and select
      <gui style="menuitem">Preferences</gui>.</p>
    </item>
    <item>
      <p>In the sidebar, select your current profile in the <gui>Profiles</gui>
      section.</p>
    </item>
    <item>
      <p>Select <gui style="tab">Command</gui>.</p>
    </item>
    <item>
      <p>From the <gui>When command exits</gui> drop down list, select one of
      the following options:</p>
      <list>
        <item>
          <p><gui>Exit the terminal</gui></p>
        </item>
        <item>
          <p><gui>Restart the command</gui></p>
        </item>
        <item>
          <p><gui>Hold the terminal open</gui></p>
        </item>
      </list>
      <p>The setting will be saved automatically when you select it.</p>
    </item>
  </steps>

  <note style="important">
    <p>If you have <link xref="pref-custom-command">set a custom command</link>
    that is non-interactive, have set the exit behavior to <gui>Exit the
    terminal</gui>, and have set the profile to be the default profile,
    <app>Terminal</app> may exit before you can see the output of the
    command.</p>
  </note>

</page>
