diff --git a/src/xinit.c b/src/xinit.c index 9016c561..4c81540d 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -2818,6 +2818,9 @@ int Tcl_AppInit(Tcl_Interp *inter) tcleval(cli_opt_tcl_post_command); } + /* Execute tcl commands given in tcl variable postinit_commands if existing */ + tcleval("eval_postinit_commands"); + if(cli_opt_quit) { tcleval("exit"); } diff --git a/src/xschem.tcl b/src/xschem.tcl index 57229bed..4a97d479 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -6477,6 +6477,13 @@ proc source_user_tcl_files {} { } } +proc eval_postinit_commands {} { + global postinit_commands + if {[info exists postinit_commands]} { + catch {eval $postinit_commands} + } +} + proc setup_tcp_xschem { {port_number {}} } { global xschem_listen_port xschem_server_getdata