dtach

dtach

dtach - A program that emulates the detach feature of screen

dtach is a tiny program that emulates the detach feature of screen, allowing you to run a program in an environment that is protected from the controlling terminal and attach to it later. dtach does not keep track of the contents of the screen, and thus works best with programs that know how to redraw themselves.

dtach does not, however, have the other features of screen, such as its support of multiple terminals or its terminal emulation support. This makes dtach extremely tiny compared to screen, making it more easily audited for bugs and security holes, and also allows it to fit in environments where space is limited, such as on rescue disks.

dtach has many possible uses, even though it is tiny. With dtach, you can:

  • Attach multiple times to the same program. Access to the dtach session is controlled through the Unix filesystem permissions; thus, you can trivially allow other people to watch your session.
  • Run a program in an environment that is protected from the controlling terminal. This means that, for instance, the program running under dtach would not be affected by the terminal being disconnected for some reason.
  • Run programs such as emacs, which tend to want full control over the terminal. dtach mostly acts as a relay, and does not mangle the text between the application and your terminal.
  • Suspend dtach without suspending the running program. dtach can handle the suspend key itself instead of passing it to the running program, which may be useful for certain programs such as ircII.

The latest version of dtach is version 0.8, which you can fetch here. Other download formats may be available at the sourceforge download area for dtach.

The changes in version 0.8 are:

 

  • When using dtach -A or dtach -c, the master will now wait until the client attaches before trying to read from the program being executed. This avoids a race condition when the program prints something and exits before the client can attach itself.
  • Instead of exiting quietly, dtach will now report any errors that occur while trying to execute the program.
  • dtach -n can now be used without a terminal.
  • dtach -A will now try to detect and remove stale sockets.
  • Removed a Linux-specific escape sequence from the code that restores the original terminal settings.
  • Changed dtach.1 to use \- for the dashes in command line options, and fix an ambiguous backslash.
  • Use non-blocking mode in the master process, and avoid data loss by ensuring that at least one attaching client succesfully completes a write.
  • Fix -e ^<char> to work with lowercase characters.
The changes in version 0.7 are:

 

  • The redraw method can now be explicitly specified on the command line (either no redraw at all, the old ^L character method, and the new WINCH signal method), since many programs only handle one or the other properly.
  • Changed the default redraw method back to the old ^L character method.
  • Changed the attach code to check the return value of select more carefully.
  • Changed the SIGWINCH handler to reinstall itself, to handle systems that always reset the handler.
  • Added more proper process group handling.
The changes in version 0.6 are:

 

  • Redraws are now handled by sending the child process a WINCH signal instead of by sending a ^L character. This should help prevent line-oriented programs (such as bash) from clearing the screen excessively.
  • Flow control is now disabled when setting raw mode on the terminal.
  • Switched to using select instead of poll.
  • Changed some exits to exit succesfully instead of non-sucessfully.
  • Updated my email address.
  • Updated to Autoconf 2.59, renaming some files in the process.
The changes in version 0.5 are:

 

  • Fix fd leakage.
  • Prevent atexit from being called twice on dtach -A.
The changes in version 0.4 are:

 

  • Slightly improved README and dtach.1
  • Portability updates thanks to sourceforge's compile farm. dtach should now work on: FreeBSD, Debian/alpha, Debian/sparc, Debian/PPC, and Solaris.
The changes in version 0.3 are:

 

  • Fixed a typo in dtach.1
  • Changed the attach code so that it tells the master when a suspend occurs.
  • Decreased the client <-> master packet size.
  • Changed the master to send a stream of text to attaching clients instead of sending a huge packet all the time.
  • Use getrlimit and dynamically allocate the data structures, if possible.
  • Added some more autoconf checks.
  • Initial sourceforge release.
You can also obtain information on how to access the CVS tree here, and access the sourceforge project page here.

You can send any comments or questions about dtach to the author. Comments and suggestions are welcome.

posted on 2012-02-22 14:16  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/02/22/2363072.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值