[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Correct error message when using -n and -o ignoreeof in inte
From: |
Robert Elz |
Subject: |
Re: [PATCH] Correct error message when using -n and -o ignoreeof in interactive mode |
Date: |
Sun, 18 Aug 2024 11:21:13 +0700 |
Date: Sun, 18 Aug 2024 02:09:10 +0200
From: Milana <94888u@riseup.net>
Message-ID: <e72ff43d-868f-4d36-99cf-1be53d25f321@riseup.net>
| I recently encountered an issue while experimenting with different shell
| options in Bash. When launching Bash with both the `-n` (noexec) and `-o
| ignoreeof` flags in interactive mode (with no pipes or redirection),
| pressing `^D` (EOF) results in the message: "Use 'exit' to leave the
| shell."
The NetBSD shell has a different approach to that issue. Whenever an
interactive shell is about to prompt for a new command, it does the internal
equivalent of "set +n" (which in bash, I am guessing from your patch,
would be something like "executing = 1;")
Interactive shells with -n (noexec) set are pointless - being able to set
it isn't always, but keeping it set certainly is. I's suggest that
bash do the same, rather than telling some poor user to type another 99
^D (or whatever) characters.
kre