Chris's Wiki :: blog/unix/WordEraseDifference Commentshttps://utcc.utoronto.ca/~cks/space/blog/unix/WordEraseDifference?atomcommentsDWiki2012-11-28T18:38:26ZRecent comments in Chris's Wiki :: blog/unix/WordEraseDifference.From 92.236.66.25 on /blog/unix/WordEraseDifferencetag:CSpace:blog/unix/WordEraseDifference:d72656bd9ff8c42e31b41cf134fe9465c1d49b13From 92.236.66.25<div class="wikitext"><p>I found the same thing useful, and since I've had these settings in a bashrc snippet:</p>
<pre>
stty werase undef > /dev/null 2>&1
bind "C-w":unix-filename-rubout > /dev/null 2>&1
</pre>
<p>..it's done word-delete separated at slashes since.</p>
<p>I've not tried this on anything non-Linux, so I don't know if it's a portable setting to any system which has bash.</p>
</div>2012-11-28T18:38:26ZFrom 195.35.72.170 on /blog/unix/WordEraseDifferencetag:CSpace:blog/unix/WordEraseDifference:f56285a4f380bc3a7bc5ae8849c3ec795a0f4fe1From 195.35.72.170<div class="wikitext"><p>I know this is a readline feature, but what does</p>
<p>backward-kill-word (M-DEL)</p>
<p>so ESC - backspace or ALT - backspace give you in your shell?</p>
<p>In my bash shell it gives me exactly what you want.</p>
</div>2012-11-27T10:39:56ZFrom 121.44.197.159 on /blog/unix/WordEraseDifferencetag:CSpace:blog/unix/WordEraseDifference:6f8f232c6d77ef77f980775fcb86fc18b9409833From 121.44.197.159<div class="wikitext"><p>zsh supports the magic variable $WORDCHARS, which is a list of characters ^W et all consider word breaks.</p>
</div>2012-11-25T10:56:04ZFrom 76.171.122.113 on /blog/unix/WordEraseDifferencetag:CSpace:blog/unix/WordEraseDifference:7882817b4b8bbab6916c236b5b512379345d0925From 76.171.122.113<div class="wikitext"><p>I've been bothered by this for several years, but hadn't thought too much about it as I don't like to do much customization of my environment as I work in quite a few different environments.</p>
<p>I hadn't realized that this was actually bash that changed this (until sometime in the early noughts I was using tcsh not bash). For some reason I decided to see if I could fix this via googling, took me over half an hour to get it to work. It is in fact a readline thing, one can just put this in their ~/.inputrc:
"\C-w": unix-filename-rubout
BUT that still didn't work for me until I added the following to my .bashrc:
export INPUTRC=~/.inputrc
(thanks to the guy mentioning that in the comments of: <a href="http://www.softpanorama.org/Scripting/Shellorama/inputrc.shtml">http://www.softpanorama.org/Scripting/Shellorama/inputrc.shtml</a>)</p>
<p>I use vi mode bash editing, and now ctrl-W (in insert mode) erases using / as a delimiter, but in command mode it still does it using whitespace as the delimiter, but I don't think that is a problem as in command mode I would just use normal vi commands.</p>
<p>Note that some people claimed one had to:</p>
<dl><dt>do</dt>
<dd>stty weerase undef</dd>
<dt>use</dt>
<dd>set bind-tty-special-chars Off #in .bashrc</dd>
</dl>
<p>but those didn't help me at all. This was with bash 4.2.24 on ubuntu, haven't tried it yet on centos 6.x box.</p>
</div>2012-11-23T17:34:06Z