github dvorka/hstr 2.4
Insert command in command prompt

latest releases: 3.1, 3.0, 2.6...
2 years ago

New HSTR release brings parameter which can be used to insert commands in terminal prompt:

$ hstr --insert-in-terminal="ls -hal"
$ ls -hal|

It is useful whenever you need to:

  • construct complex command using a shell script to modify current shell with source and check and/or edit it prior running:
$ hstr --insert-in-terminal="`my-script-which-constructs-command.sh`"
$ export CONDA_INSTALL_DIR=/opt/conda/acme && unset PYTHONPATH && source ../.rc_conda && conda activate env_prj|
  • insert command to terminal prompt directly from a shell script to modify current shell:
$ cat my-script-which-inserts-command.sh
...
hstr --insert-in-terminal="${CMD} -vvv ${REQUIRED_PARAMS} ${OPTIONAL_PARAMS} ${2}"
...
$ ./my-script-which-inserts-command.sh
ACME builder:
  clean ... DONE
  build ... DONE
Ready to test product:
$ pytest -vvv -n 8 --use-fixture-cache tests/feature_test.py::test_case|

Overall this feature aims to help you to be faster and get more out of your shell scripts.

Enjoy!


| in the examples above indicates cursor position

Don't miss a new hstr release

NewReleases is sending notifications on new releases.