aboutsummarylogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorChristoph Lohmann2013-06-06 19:09:18 +0200
committerChristoph Lohmann2013-06-06 19:09:18 +0200
commitc8238c328edad329ef1146eed08bf86265d6c470 (patch)
tree77bb110f347ef8af4c5048ed9ab77885b6ef928d /st.c
parentd8ffee2fc27b7f2ed3d7e6cdb32c517f0b9dd7bb (diff)
downloadaur-c8238c328edad329ef1146eed08bf86265d6c470.tar.gz
Adding xterm behaviour to setting the title.
Thanks Airwave!
Diffstat (limited to 'st.c')
-rw-r--r--st.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/st.c b/st.c
index 9a7891ed4b47..28c083adf2b0 100644
--- a/st.c
+++ b/st.c
@@ -19,6 +19,7 @@
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
+#include <libgen.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -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) {
+ titles = strdup(argv[1]);
+ opt_title = basename(titles);
+ }
+ }
goto run;
case 'f':
opt_font = EARGF(usage());