As a more general version to this question, is there a way to forward-delete in a bash terminal that doesn't involve Fn+Delete or Control+D?
Motivation: When using the Macports
port command interactively, the standard Fn+Delete does not forward-delete, but instead produces a tilde
~. The only way I'm aware of to forward-delete is by using Control+D.
However, this can be dangerous -- if there is no text to delete, it will automatically exit the
port interactive shell and return to the regular shell. If Control+D is pressed again (with nothing to delete), this will cause the shell to log out. If not timed precisely, one can easily accidentally hold the Control+D key combination too long, causing unintended behavior.
Is there a safe alternative to forward-delete, generally in bash, in Terminal.app, or specifically in the Macports interactive shell?