Commit Graph

68 Commits

Author SHA1 Message Date
David Phillips 5efde80b0f Merge 8d0487a0c5 into 15ae398ea5 2015-08-04 02:48:47 +00:00
Marc André Tanner 42962ff827 Cleanup socket directory creation code 2015-08-03 12:28:09 +02:00
Marc André Tanner 4ab9cb7fcc Fix display of status flags in session list 2015-07-30 12:20:41 +02:00
Marc André Tanner 64713a3219 Only delete stale sockets if they are sockets in the first place 2015-07-30 12:19:06 +02:00
Marc André Tanner 277f4d154d Improve detection and handling of stale sessions
With this it should be possible to create sessions for which a
dead left over socket still exists. Also the session list as
printed by abduco without any arguments will delete those stale
sockets.
2015-07-30 11:52:46 +02:00
Ross Mohn 91feaaa9f9 Fix strange behavior with abduco -A
Here are the steps:

1) Run 'abduco -A foo ping suckless.org'

2) Press 'CTRL+\' to detach

3) Run 'abduco -A foo' to reattach

4) Press 'CTRL+\' and it flashes the screen but does not detach

5) Press 'CTRL+\' a second time and it detaches this time

Here's what the output looks like:

    $ abduco -A foo ping suckless.org
    abduco: foo: detached
    $ abduco -A foo
    abduco: foo: detached
    abduco: foo: detached
    $

Also, oddly, I am only seeing this behavior on my Ubuntu Linux host, not
my AIX hosts.
2015-06-23 13:04:16 +02:00
David Phillips 8d0487a0c5 Removed old debug fprintf 2015-06-09 16:04:40 +12:00
David Phillips eaf0680276 Allow for squashing of command line options together 2015-06-09 16:00:27 +12:00
Marc André Tanner cefcaeb451 Update man page 2015-02-26 15:30:11 +01:00
Marc André Tanner ca60dc72f4 Improve -f handling
As an example -A -f should probably not create a new session
if the old one is still running.
2015-02-26 15:15:18 +01:00
Marc André Tanner e738f82956 Allow read only attaches to newly created sessions 2015-02-26 14:13:19 +01:00
Marc André Tanner ad1d370a48 Remove left over from -C flag 2015-02-26 14:12:47 +01:00
yy 0102cf840e Remove -C mode, in favour of a -f flag
that works with -c, -n or -A, which forces the creation of a
new session when there is an existing but already terminated
session of the same name.
2015-02-26 13:58:05 +01:00
Marc André Tanner 2dd042f974 Fix access permissions on non-Linux systems
Create sockets in a per user directory with proper permissions
either in

 $HOME/.abduco/session-name

or if not possible in

 /tmp/abduco/$USER/session-name
2015-02-25 23:24:40 +01:00
Marc André Tanner ad05af340a Change some year numbers to 2015 2015-02-19 17:46:05 +01:00
Marc André Tanner 64920e5977 Simplify maximum socket name length check 2015-02-17 22:49:14 +01:00
Marc André Tanner 98ac772a97 Set packet length to zero on error case 2015-02-17 22:49:14 +01:00
Marc André Tanner f02c3fc3c0 Fix validation creteria 2015-02-17 00:34:44 +01:00
Marc André Tanner bd3dcba548 Validate packet size before sending/receiving 2015-02-17 00:20:38 +01:00
Marc André Tanner e4a6b01fdc Make error handling more robust 2015-02-16 23:40:25 +01:00
Marc André Tanner d1a44a9c1a Check return value of open(2) #30720 2015-02-16 22:54:32 +01:00
Marc André Tanner bb7c859b5f Also NUL terminate string in error case #30714 2015-02-16 22:44:29 +01:00
Marc André Tanner 76bae5939f Improve terminal restoring
Instead of simply moving the cursor to the bottom of the screen
use the alternate screen buffer i.e. the smcup/rmcup capabilities.

This is currently hardcoded to the xterm originated \e[?1047{h,l}
sequence. I also patched dvtm to support these.
2014-12-22 13:32:42 +01:00
David 1946d8387a Added -C option
for collection of exit status and creation of new session in one go
2014-12-22 13:32:42 +01:00
Marc André Tanner 0a94807d60 Better error message in case session name is too long 2014-12-22 13:32:41 +01:00
Marc André Tanner 3cfa99a031 Decouple socket path lookup logic 2014-12-22 13:23:26 +01:00
Jason Swank d4a74a23d7 Allows abduco to compile on DragonFly BSD 2014-12-09 19:46:46 +01:00
Brandon Mulcahy 5ac6537927 Use more descriptive execvp error message 2014-11-10 13:48:52 +01:00
Marc André Tanner eabb140a38 Use _POSIX_C_SOURCE and _XOPEN_SOURCE instead of _GNU_SOURCE 2014-10-16 21:24:51 +02:00
Marc André Tanner 5b503c838f Set _GNU_SOURCE in config.mk 2014-10-16 21:20:02 +02:00
Marc André Tanner 35117affb9 Correct function definitions without parameters 2014-10-10 20:43:06 +02:00
Ross Mohn 9e6490da33 AIX support 2014-09-26 21:07:32 +02:00
Marc André Tanner ef36456177 Do not display hostname suffix in session listing
Trying to attach to an existing session with its hostname does not
work, therefore avoid confusion and do not display it.
2014-09-08 21:03:10 +02:00
Marc André Tanner b2f2dc810d Suffix session names with '@hostname' 2014-09-08 19:39:46 +02:00
Marc André Tanner b722e48f55 Simplify Solaris detection 2014-07-08 23:00:39 +02:00
Marc André Tanner 119d7c8bca Add Solaris support 2014-07-07 22:46:14 +02:00
Marc André Tanner d23c9982c7 Avoid usage of non-ISO-standard escape sequences 2014-07-07 20:20:46 +02:00
Marc André Tanner 7b95d5b65e Only list sockets in session list 2014-06-30 15:02:00 +02:00
Marc André Tanner 9e29a968d8 Fix race condition on command execution
There are now two different pipes used for synchronization purposes.
2014-06-24 10:50:10 +02:00
Marc André Tanner 77db580a63 Remove trailing white spaces 2014-06-20 13:29:37 +02:00
Marc André Tanner ba2e6a4248 Try to find a socket directory where bind(2) succeeds 2014-06-20 12:35:17 +02:00
Marc André Tanner 76bbea220b Pass correct window size to underlying application 2014-06-19 10:30:03 +02:00
Marc André Tanner 54c1dbddb2 Mark zombie sessions with '+' symbol
These are sessions which have no clients connected but their underlying
command already terminated.
2014-06-18 14:28:31 +02:00
Marc André Tanner a7e13911c5 Fix -n mode: do not wait for clients to connect 2014-06-18 13:24:59 +02:00
Marc André Tanner 3e4485642b Do not start server main loop if execvp(3) failed 2014-06-18 13:24:56 +02:00
Marc André Tanner eccf9fd16e Introduce read only sessions (-r option)
Based on a patch from Lars Kellogg-Stedman.
2014-03-22 17:27:59 +01:00
Marc André Tanner 1fbc4690e5 Remove unused code 2014-03-22 00:25:57 +01:00
Marc André Tanner 15169cda58 Use STDIN_FILENO instead of 0 2014-03-21 23:08:42 +01:00
Marc André Tanner 6000bc6240 Request screen size if most recently connected client disconnects 2014-03-21 21:57:50 +01:00
Marc André Tanner a99e46fd23 Simplify I/O handling 2014-03-21 20:40:55 +01:00