It works with everything but I use it with vi most of all.
You can even sleep as many processes as you like and choose which one to return to the foreground as needed.
It works with everything but I use it with vi most of all.
You can even sleep as many processes as you like and choose which one to return to the foreground as needed.
# Allow Ctrl-z to toggle between suspend and resume
function Resume {
fg
zle push-input
BUFFER=""
zle accept-line
}
zle -N Resume
bindkey "^Z" ResumeThrew it in my .zshrc right away. Thank you sir.
bind \cz 'fg 2>/dev/null; commandline -f repaint'
from: https://github.com/fish-shell/fish-shell/issues/7152#issueco...Saw this in the internets
if [[ $- == i ]]; then
stty susp undef
bind '"\C-z":" fg\015"'
fiThat said, if you wanted to continue running in the background with `bg`, you could make that substitution to allow you to double tap Ctrl-z to do so.
1. Installs msys2 (which includes pacman package manager) # can be done separately from your git installation
2. pacman -S tmux # install tmux to msys2 within msys2
3. Copy tmux.exe and msys-event-2-1-7*.dll from msys2 to C:\Program Files\Git\usr\bin # may be a different version msys-event
4. Uninstall msys2! This was important to me because I found edge cases where msys2 did not honor directory links as "not msys files" and it borked things. YMMV
Now that I'm on Win11, I definitely need to revisit that - thanks for the reminder!
The only downside, though, is the clipboard won't be as easily accessible. I'm thinking of things like piping text to clip.
$ ls -al | clip
Command 'clip' not found, but can be installed with:
sudo apt install geomview
"geomview" has something to do with 3D images.I tried this with Ubuntu 18 and 20 ...
I use this plugin: https://github.com/akinsho/toggleterm.nvim
Nvim also has a new --listen flag (if you ever tried nvr this is now built in). So no matter where you are the file will open in your main nvim instance.
No need to exit.
#!/bin/sh
# turn off stupid flow control and shut up.
stty -ixon -ixoff 2>/dev/null
The real issue is when you do ctrl-z from muscle memory on Windows while running nvim from cmd (through wsl runner but not from an actual shell) and then it just disappears and takes your data with it.
- you get a new shell, so your history is lost
- if you have a "stack" of vim's you have to return to them in stack order
- I develop a habit of typing Ctrl-d when I want to get back to vim, which means I accidentally log out of SSH sessions all the time if I actually haven't still got vim open
I think getting in the habit of using Ctrl-z instead would be a big improvement.
To prevent that from happening you can add this to your .bashrc
#write to history file at each shell prompt
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"So far it's a 6/10 Slightly better then not doing it. =)
However shelling out was intrinsic to my workflow. We didn’t have screen or any of the other common multi session terminal programs at the time.
One day I decided to log out. I rarely logged out. If anything I was kicked off by a system restart.
So to log out I started closing sessions. Turns out I was at least 30 deep. Some files were being edited more than once, I even had shells within shells (which typically did to play ENV shenanigans).
It was adopted by the Korn shell, then codified into the POSIX shell.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/j...
:!ack "stupid_structure->who_wrote_this_crap.oooohhhhh\s+="
(and if you wonder what "ack" means: https://beyondgrep.com/)
It’s not a trivial thing to support though. ‘jobs’, ‘bg’ and ‘fg’ need to be shell builtins. Other shell builtins might not work if they’re not POSIX fork()s and you need to handle STDIN a little more carefully.
It’s a lot of work for a feature that many alt shell users might not even be aware of.