aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2013-06-06 19:09:18 +0200
committerChristoph Lohmann <20h@r-36.net>2013-06-06 19:09:18 +0200
commit369734c80c6e5049d704a00f436c59ecf4dafae8 (patch)
treefb6472eb9c48a6048486049561386100ee135b4f /st.c
parent2cf4f366d615a4e5ed199f90e6cdb7741606a38e (diff)
downloadst-369734c80c6e5049d704a00f436c59ecf4dafae8.tar.gz
st-369734c80c6e5049d704a00f436c59ecf4dafae8.tar.bz2
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 9a7891e..28c083a 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());