Open TroyMitchell911 opened 1 day ago
It seems difficult because it is necessary to handle the execution of Shell commands.
Please reconsider the necessity of this feature; clarifying the specific use case might make its value clearer.
In vim or tmux, we can use the touchpad to switch windows
Sorry, Idk if it's diffcult. but how fg
works? I think it's similar to the principle of fg
.
I don't know. However the behavior of fg
and bg
is dependent on the shell implementation.
Would it be possible to create a script that retrieves the foreground process using any commands?
I don't know. However the behavior of
fg
andbg
is dependent on the shell implementation.Would it be possible to create a script that retrieves the foreground process using any commands?
of course. I run a vim in a zsh terminal. it's search child process here:
❯ ps --ppid 76432
PID TTY TIME CMD
184521 pts/0 00:00:01 vim
and it's search a vim process and it's parent process:
#!/bin/sh
VIM_PID=$(pgrep vim)
# parent pid
PPID=$(ps -o ppid= -p $VIM_PID)
ps -p $VIM_PID
ps -p $PPID
If you can get what application is selected, I think you can get it's pid?(sorry I don't know ruby so I didn't check source code)
You can through system call to get these information. e.g. procfs
getppid
sysctl
Hi. Can you add detection of foreground applications in the terminal? When I use this tool, I can only detect Gnome-shell. I think it should also list the foreground applications in the shell, which is a reasonable feature. It can get rid of long shortcut keys in vim and more app.
If I knew ruby, I would definitely submit a PR...