dealforest (owner)

Revisions

gist: 135393 Download_button fork
public
Public Clone URL: git://gist.github.com/135393.git
Embed All Files: show embed
screen-mac-pbcopy.patch #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- mark.c.orig 2009-06-25 02:03:01.000000000 +0900
+++ mark.c 2009-06-25 02:03:50.000000000 +0900
@@ -59,6 +59,8 @@
 static void MarkRedisplayLine __P((int, int, int, int));
 static int MarkRewrite __P((int, int, int, struct mchar *, int));
 
+void pbcopy(const char *strings);
+
 extern struct layer *flayer;
 extern struct display *display, *displays;
 extern struct win *fore;
@@ -484,6 +486,18 @@
 
 /**********************************************************************/
 
+void pbcopy(const char *strings)
+{
+ FILE *pipe;
+ pipe = popen("/usr/bin/pbcopy", "w");
+ if (pipe == NULL) {
+ LMsg(0, "pbcopy failed: %s", strerror(errno));
+ return;
+ }
+ fprintf(pipe, "%s", strings);
+ pclose(pipe);
+}
+
 
 void
 MarkRoutine()
@@ -1045,6 +1059,7 @@
  newcopylen);
  else
  LMsg(0, "Copied %d characters into buffer", md_user->u_plop.len);
+ pbcopy(md_user->u_plop.buf);
  if (write_buffer)
  WriteFile(md_user, (char *)0, DUMP_EXCHANGE);
  in_mark = 0;
--- pty.c.orig 2009-06-25 02:03:01.000000000 +0900
+++ pty.c 2009-06-25 02:03:57.000000000 +0900
@@ -40,7 +40,7 @@
 
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
 #ifdef HAVE_STROPTS_H
-# include <sys/stropts.h>
+//# include <sys/stropts.h>
 #endif
 
 #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)