<p>This sounds like a problem with your terminal settings.  Quoting the <strong>Setting up IRAF</strong> section <a href="http://mips.as.arizona.edu/~khainline/intro_to_IRAF.html" rel="nofollow noreferrer">this page</a>, "We assume the user has defined this correctly when issuing the MKIRAF and no longer key off the unix TERM to set a default."  The page goes on to say that one should add <code>stty xgterm</code> the to your <code>login.cl</code> file (directly above the final <code>keep</code> line might be a good place).  The page linked above goes into more detail.</p>

CC BY-SA 4.0
2019-01-11T10:01:33.917Z
Thanks, I already had `stty xgterm` in my `locin.cl`.
Evgenii
CC BY-SA 4.0
2019-01-11T10:04:38.383Z
@Evgenii Does it appear after all other mentions of `stty` and also not within a conditional block (`if (`...`) {` ... `} else {` ... `}`)?
Alex Hajnal
CC BY-SA 4.0
2019-01-11T23:11:06.317Z
Yes, stty xgterm is the only stty command and it is not within any other blocks.
Evgenii
CC BY-SA 4.0
2019-01-11T03:08:31.687Z
2019-01-11T03:39:02.163Z
2019-01-11T03:39:02.163Z
Alex Hajnal
<p>Sometimes it does not let me delete text in an xgterm terminal and outputs ^H instead.</p>

<p>Example:</p>

<p>Run IRAF:</p>

<pre><code>xgterm -e cl
</code></pre>

<p>It opens the xgterm, there I type:</p>

<pre><code>splot black_hole.fits[0]
Image line/aperture to plot (0:) (12): 192
</code></pre>

<p>Then I realise I made a mistake and press the Delete key on Mac, and it writes the ^H text instead:</p>

<pre><code>Image line/aperture to plot (0:) (12): 192^H^H
</code></pre>

<p>This is very annoying. Is there a way to fix it? </p>

<p>Note that delete key works in xgterm initially, but breaks and writes ^H in the case above.</p>

<p>I've installed IRAF 2.16 through astroconda iraf-all package on Mac.</p>

<h2>Update</h2>

<p>The only solution I found was to use PyRAF instead. PyRAF uses the normal Mac's terminal, which does not have those Delete key issues. I can still run the same IRAF commands in PyRAF terminal, so it works fine for me.</p>

CC BY-SA 4.0
2019-01-11T03:13:25.270Z
I had originally suggested migrating this to Unix.SE or Apple.SE however, this question is about a quirk of how IRAF (used by astronomers to analyze images and spectra) handles terminal settings.  IMO then it is on-topic.
Alex Hajnal
<spectroscopy>
Delete key does not always work in IRAF's xgterm on Mac
Evgenii
# Delete key does not always work in IRAF's xgterm on Mac

(Asked by: username_0 on 2019-01-10)

Sometimes it does not let me delete text in an xgterm terminal and outputs ^H instead.

Example:

Run IRAF:

```
xgterm -e cl

```

It opens the xgterm, there I type:

```
splot black_hole.fits[0]
Image line/aperture to plot (0:) (12): 192

```

Then I realise I made a mistake and press the Delete key on Mac, and it writes the ^H text instead:

```
Image line/aperture to plot (0:) (12): 192^H^H

```

This is very annoying. Is there a way to fix it?

Note that delete key works in xgterm initially, but breaks and writes ^H in the case above.

I've installed IRAF 2.16 through astroconda iraf-all package on Mac.

## Update

The only solution I found was to use PyRAF instead. PyRAF uses the normal Mac's terminal, which does not have those Delete key issues. I can still run the same IRAF commands in PyRAF terminal, so it works fine for me.

**Tags:** spectroscopy

> **Comments:**
> **username_1**: I had originally suggested migrating this to Unix.SE or Apple.SE however, this question is about a quirk of how IRAF (used by astronomers to analyze images and spectra) handles terminal settings.  IMO then it is on-topic.  

---

## 1 answers

### Answer by username_1 on 2019-01-11. Score: 2

This sounds like a problem with your terminal settings. Quoting the **Setting up IRAF** section [this page](http://mips.as.arizona.edu/~khainline/intro_to_IRAF.html), "We assume the user has defined this correctly when issuing the MKIRAF and no longer key off the unix TERM to set a default." The page goes on to say that one should add `stty xgterm` the to your `login.cl` file (directly above the final `keep` line might be a good place). The page linked above goes into more detail.

> **Comments:**
> **username_0**: Thanks, I already had `stty xgterm` in my `locin.cl`.  
> **username_1**: @username_0 Does it appear after all other mentions of `stty` and also not within a conditional block (`if (`...`) {` ... `} else {` ... `}`)?  
> **username_0**: Yes, stty xgterm is the only stty command and it is not within any other blocks.  

---

