hstr
hstr copied to clipboard
Doesn't work with multiline history records
Doesn't work with multiline history records
echo """1
2
3
"""
after looking up in hstr
it finds and inserts only echo """1\
which only first line.
I admit that this behavior is intentional as I didn't know how to fit multi-line history records in commands list nicely...
@zdmytriv @max-lobur would you have any suggestion/preference how can I improve HSTR? Like making multi-line command single line and indicating new lines using a character... any other idea?
@dvorka thanks for takin a look. "\n" will be totally ok, usually other lines are just args, I primarily search for a command name not args, so this will work. Kind of
command --arg 1 --arg 2 \n...
or
command --arg 1 --arg 2\n--arg 3 --arg 4
both will be better than trimming
How about simply indenting the multilines by 1 or 2 whitespaces? As of now all history entries start on the very left, so indenting could be used to hint at a multiline entry.
You would lose too much useful space
Even if it didn't show all the lines, at least if it could insert them right that'd be much better already.
Am I also fine if it displays first line only as long as long as full version is used.
This would be super useful! Currently having a difficult time with ROS commands like:
rostopic pub -r 10 /husky_velocity_controller/cmd_vel geometry_msgs/Twist "linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
Does shopt -s cmdhist
make a difference? This link might be useful:
https://unix.stackexchange.com/questions/353386/when-is-a-multiline-history-entry-aka-lithist-in-bash-possible/353407
Is there any workaround for this?
I am also looking for this
Same here!
Initially I had both shopt -s cmdhist
and shopt -s lithist
enabled, but this doesn't work.
Just having shopt -s cmdhist
enabled works somewhat. When it's possible the command will be a single line separated by ;
. But for example multiline strings are still not supported
I am also looking for this
same here