Issue
I want to open a new tab in the terminal application (gnome-terminal
, io.elementary.terminal
, ..), execute the command via --
, and see the command in the bash history, so I tried:
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
$ gnome-terminal -t foo -- bash -i -c 'history -s ls; bash'
but when I press PageUp
in the newly created terminal ls
neither history -s ls
is not last used command in bash history. Why?
Solution
Missing exec
:
$ gnome-terminal -t foo -- bash -i -c 'history -s works; exec bash'
$ konsole --new-tab -e bash -c -i 'history -s works; exec bash'
$ io.elementary.terminal -t -e "bash -c -i 'history -s works; exec bash'"
works as expected.
Answered By - ldrahnik Answer Checked By - Cary Denson (WPSolving Admin)