WindTerm
WindTerm copied to clipboard
[Feature Request] Automatically run User-defined Script when Session opens
Hello! When I open an existing session to a remote server, I hope it can automatically run pre-defined scripts, such as:
- open certain file, e.g.,
cat ~/.bash_profile
- open some dynamic command, e.g.,
watch -n 1 "ps -ef | grep -v grep | grep mysqld"
orwatch -n 1 "ip a s"
Thus, when I restart windTerm, the whole groups I created and each session in each can be the same before windTerm restart.
Welcome. Is Session Settings Dialog - SSH - Authentication - Execute command after authentication
what you need?
Welcome. Is
Session Settings Dialog - SSH - Authentication - Execute command after authentication
what you need?
Thanks for your reply!
I tried to config Execute command after authentication
to execute, e.g., ip a
.
However, when windTerm restarts, ip a
shows in the console unexecuted, unless I press enter
in this session.
If I use ssh [email protected] ; ip a
or ssh [email protected] && ip a
, when I press enter
, the second command ip a
cannot be executed, nor does it show in the console.
If I open two views of the same server ip side by side, when windTerm restarts, both of them are shown with the same command.
Sum it up:
- command needs to be executed automatically after successful authentication;
- multiline scripts also needed, e.g, commands in
Quick Commands
can be reused here; - each view of the same server ip needs to be configurable, to run different commands.
Thanks!
However, when windTerm restarts,
ip a
shows in the console unexecuted, unless I pressenter
in this session.
You need to add \n
at the end - ip a\n
.
ssh [email protected] ; ip a
orssh [email protected] && ip a
,
In both of these examples the ip
command would get executed on the local machine after the ssh connection is terminated.
This is probably what you are looking for ssh [email protected] -t 'ip a; bash -l'
.
However, when windTerm restarts,
ip a
shows in the console unexecuted, unless I pressenter
in this session.You need to add
\n
at the end -ip a\n
.
ssh [email protected] ; ip a
orssh [email protected] && ip a
,In both of these examples the
ip
command would get executed on the local machine after the ssh connection is terminated.This is probably what you are looking for
ssh [email protected] -t 'ip a; bash -l'
.
Thanks for you suggestion, I succeed to run ip a\n
after authentication, so my suggestion 1 has been resolved.
However, every terminal with the same server ip ran the same command ip a\n
.
So my suggestions are still here:
- multiline scripts also needed, e.g., commands in Quick Commands can be reused here;
- each view of the same server ip needs to be configurable, to run different commands.
Thanks!