DISLOCATE(1)

โœจ DISLOCATE โœจ

okay bestie, welcome to dislocate ๐Ÿ’… a whole General Commands Manual moment, and honestly? it's giving underrated icon. let's get into it.


๐ŸŒธ NAME ๐ŸŒธ

Dislocate โ€” disconnect and reconnect processes ๐Ÿฆ‹

like, you just... walk away from a process and come back to it later? yes. that's the whole vibe.


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

dislocate [ program args...  ]

๐Ÿ’– INTRODUCTION ๐Ÿ’–

so Dislocate lets processes be disconnected and reconnected to the terminal โœจ literally the main character of not-losing-your-work. possible uses, no cap:

  • you can disconnect a process from a terminal at work and reconnect from home, to continue working ๐Ÿ 
  • after having your line be dropped due to noise, you can get back to your process without having to restart it from scratch ๐Ÿ˜ญ (the relief. the relief.)
  • if you have a problem that you would like to show someone, you can set up the scenario at your own terminal, disconnect, walk down the hall, and reconnect on another terminal ๐Ÿšถโ€โ™€๏ธ
  • if you are in the middle of a great game (or whatever) that does not allow you to save, and someone else kicks you off the terminal, you can disconnect, and reconnect later ๐ŸŽฎ

periodt. that's the pitch.


๐Ÿซถ USAGE ๐Ÿซถ

when you run it with no arguments, Dislocate tells you about your disconnected processes and lets you reconnect to one ๐Ÿ‘‘

otherwise, Dislocate runs the named program along with any arguments.

by default, ^] is an escape that lets you talk to Dislocate itself ๐Ÿ’ฌ at that point, you can disconnect (by pressing ^D) or suspend Dislocate (by pressing ^Z).

any Tcl or Expect command is also acceptable at this point ๐Ÿ‘€ for example, to insert the contents of the file /etc/motd as if you had typed it, say:

send -i $out [exec cat /etc/motd]

to send the numbers 1 to 100 in response to the prompt "next #", say:

for {set i 0} {$i<100} {incr i} {
    expect -i $in "next #"
    send -i $out "$i\r"
}

scripts can also be prepared and sourced in so that you don't have to type them on the spot ๐Ÿ“ iconic behaviour honestly.

Dislocate is actually just a simple Expect script ๐Ÿงš feel free to make it do what you want it to do, or just use Expect directly, without going through Dislocate. Dislocate understands a few special arguments ๐Ÿ‘‘ these should appear before any program name. each should be separated by whitespace. if the arguments themselves take arguments, these should also be separated by whitespace.

the -escape flag sets the escape to whatever follows ๐ŸŒˆ the default escape is ^].

ok so pro tip from me to you: that -escape thing goes before the program name, got it? slay.

๐Ÿ’€ CAVEATS ๐Ÿ’€

this program was written by the author as an exercise to show that communicating with disconnected processes is easy โœจ there are many features that could be added, but that is not the intent of this program. so like, don't come for it for being minimal โ€” it's minimal on purpose, bestie ๐Ÿ™ˆ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • Tcl(3), libexpect(3)
  • "Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. ๐Ÿ“š

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Don Libes, National Institute of Standards and Technology ๐Ÿซถ


and that's the whole page, fr fr ๐Ÿ’œ this was the General Commands Manual, dated 7 October 1993, and it's lowkey a legend. go disconnect something and reconnect to it later like the icon you are. bye bestie! ๐ŸŽ€โœจ