Zsh: set aside a command with “Escape Q” / push-line 0 ▲ Adam Johnson 1 hour ago · Tech · hide · 0 comments Do you ever do this? You carefully type out a command, like this pytest one: $ pytest tests/test_checkout.py -k discount --reuse-db -x …then, just before pressing Enter, you remember that something will stop it from succeeding, like being on the wrong Git branch. What now? Maybe you run the command anyway, to put it in your history, letting it fail or cancelling it with Ctrl-C. Then you can run your setup command. Or maybe you press Ctrl-A to jump to the start, and add the setup command first, like git switch fix-discounts &&, and press Enter. Then both commands will run together, but they’re in one combined history entry. Both of these options work, but they’re fiddly. Zsh has a neater feature to help here: the push-line widget. Press Escape, release it, then press q. Zsh stores your current command away and clears the prompt, ready for a different command: $ pytest tests/test_checkout.py -k discount --reuse-db -x<Escape q> $ Now you can run whatever you need, such as switching… No comments yet. Log in to reply on the Fediverse. Comments will appear here.