简体   繁体   中英

How can I configure the “delete” key to delete a word in c shell

I tried to do "stty werase [3~", "stty werase ^H" " stty werase ^?" , but nothing has helped. Do you have any idea how to configure the DEL / delete key to delete a word in c shell?

Thanks,

If you're using tcsh rather than csh, this should work:

bindkey '^[[3~' backward-delete-word

I don't think stty can map multi-character sequences, but you might be able to configure your terminal emulator so that Delete sends an ASCII DEL character. In xterm, right-click and enable the "Delete is DEL" option, or set the X resource:

XTerm*deleteIsDEL:      True

You can then use

stty werase '^?'

(the single quotes aren't actually necessary). Other terminal emulators should also have some mechanism to cause Delete to send ASCII DEL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM