4 ms·
personally I don't use shell buffer because it doesn't do command line recall like I expect. In a normal terminal control-r <characters> recalls the last comma
by m463 3y ago
personally I don't use shell buffer because it doesn't do command line recall like I expect.
In a normal terminal control-r <characters> recalls the last command with those keys, and control-p/n will go back/forward in the history.
with the shell buffer I move upwards in the buffer to recall a command.
(is there a way to configure this differently?)
EDIT: ok it seems like meta-r and meta-p/n do the same thing - kind of.
hmmm, but meta-r doesn't seem to recall from the shell history? It is either a different history or truncated.
- earthscienceman 3y agoFYI, I use vterm with a few custom keys so that it operates exactly as if it were just a standard terminal emulator.
- gumby 3y agoWhy bother? Real question — seems like no advantage over a terminal window, except you can c-x b to it. Perhaps that's enough?
- earthscienceman 3y agoUmmm. It probably depends on the kind of work you do in the terminal but for me it was a game changer. Being able to pull in any of the text from a terminal into a buffer, easily, without copy paste or mouse is a massive game changer for the type of work I do. I can operate on any of the text in the terminal the same way I would emacs, and pull it into a code buffer. Selectively pulling in random long directory paths, etc etc. I can also drop anything from notes or code into a terminal without needing to dance around. It also turns emacs (server-mode) into a really great replacement for tmux/screen. tmux behaves very strangely in how it instantiates the very first window, calling the process after that window and killing that window can kill all your tmux sessions. I run emacs as a daemon on my HPC clusters and have it monitor jobs and more via vterm.
- gumby 3y agoYeah, I guess my use case is completely different; shell mode is great and vterm goes the wrong way. But I never run even curses programs in the terminal, just text all the way. The great thing about emacs is you can use what works for you!
- gumby 3y agoYou can use m-p/n as you mention, same as, say, in regular bash, or search. Or c-c c-p, c-c c-o etc. But TBH I mostly just use the ordinary ! syntax (e.g. `!!` or `!bla:*` or !200 etc) because it’s even faster and works fine even when no editing is available at all. So if I used find to search for an executable it’s just so effortless to type ./`!!|head -1` rather than searching up, selecting and copying a region, going back to the end, editing it, blah blah. Or even worse, reaching for the mouse.
- notbeuller 3y agoI wonder what percentage of even frequent shell users are even aware of !! or ^subst^ - an informal polling of 5 workmates here (engineers, command line git users, people I would have thought would know) shows no takers. To be fair, I'm old and was thrilled to go from 300 to 1200 baud at one point.
- gumby 3y agoWow, I assumed it was universal. Retyping things, or copying and editing is so tedious.
- guenthert 3y agoI recall that at University a lecturer showed this briefly in the early nineties. Most of us students stared in a mixture of awe and disbelief. I didn't learn those incantation from that brief introduction and never felt the need, even though I used a 2400 baud modem (already outdated, hence cheap) then.
- m463 3y agoI use control-r a LOT. It lets you look at and edit what you'll re-type. I use it for complicated commands I ran yesterday and the day before. Unfortunately my hands are wired for control-r (caps lock = ctrl) and not meta-r. Hard to figure out the ROI of re-learning. (still emacs recall history doesn't seem to reflect bash history, which I routinely set to 10k commands)