Tl;dr QuestionIs there a nice way to interactively edit a string from the shell, storing the edited value in a variable.Basically exactly like a=$(cat hello world > /tmp/command &&  vim /tmp/command </dev/tty >/dev/tty && cat /tmp/command) but without clearing my screen while editing (so that I don't lose my place and can still read output from previous commands).I really want behaviour exactly like imv or icp, but I just want to get given the string back rather than moving or copying a file.Or like a=$(echo hello world | zenity --entry-text $(cat) --entry) but without X.This is rather an I WANT A PONY type question, but it feels useful in general situations.ContextStack exchange loves context, so here is my specific use case:I love zsh line editing. I'm using it for a zsh widget to add parts of a command in my history to my current line like so:strace <M-l h>-><LIST of history commands>->SELECT COMMAND->POP UP EDITOR->TWEAK COMMAND->strace command with lots of arguments some of which I want to editAlternatives consideredMake use of the shell's command-line editor and history (!!) to do what I want.Using zenity echo hello | zenity --entry-text -entry  <- I don't really like using X
Way of interactively editing some text from the shell
shell
You're describing something like the zsh vared builtin. It puts the current value of a variable into ZLE, and when you finish editing, the edited line becomes the new value of the variable.% x=foo% vared xfoo[Do some edits to change foo to bar and press Return]% echo $xbar