X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=2811876adf260efa70edcafc211acc0da6c2e746;hb=7af030c999ba87cad2f3155bb9f58bf2854ad2bb;hp=9a7891ed4b4799d22eef45f3a3c33e9f955c6607;hpb=7530694987596642b0b83db1c4a61f2794c20397;p=st.git diff --git a/st.c b/st.c index 9a7891e..2811876 100644 --- a/st.c +++ b/st.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -3622,6 +3623,7 @@ int main(int argc, char *argv[]) { int bitm, xr, yr; uint wr, hr; + char *titles; xw.fw = xw.fh = xw.fx = xw.fy = 0; xw.isfixed = False; @@ -3635,8 +3637,13 @@ main(int argc, char *argv[]) { break; case 'e': /* eat all remaining arguments */ - if(argc > 1) + if(argc > 1) { opt_cmd = &argv[1]; + if(argv[1] != NULL && opt_title == NULL) { + titles = strdup(argv[1]); + opt_title = basename(titles); + } + } goto run; case 'f': opt_font = EARGF(usage());