Linux 打开现有流程
我通过远程连接(xrdp)在Linux中使用Eclipse。我的互联网断开了,所以我在eclipse运行时与服务器断开了连接 现在我再次登录,并执行“top”命令,我可以看到eclipse正在运行,并且仍然使用我的用户名 <> P>是否有某种方法可以让我回到这个过程中(我不想杀死它,因为我正在检查一大堆代码)?在我再次登录后,它不会显示在底部面板上 以下是“顶部”输出:Linux 打开现有流程,linux,eclipse,unix,rdp,Linux,Eclipse,Unix,Rdp,我通过远程连接(xrdp)在Linux中使用Eclipse。我的互联网断开了,所以我在eclipse运行时与服务器断开了连接 现在我再次登录,并执行“top”命令,我可以看到eclipse正在运行,并且仍然使用我的用户名 P>是否有某种方法可以让我回到这个过程中(我不想杀死它,因为我正在检查一大堆代码)?在我再次登录后,它不会显示在底部面板上 以下是“顶部”输出: 这是一个长期的尝试,但你可以尝试这个小程序 我以为你把它保存在“totop.cpp”里了 它有一个我不知道如何解决的问题: 如果W
这是一个长期的尝试,但你可以尝试这个小程序 我以为你把它保存在“totop.cpp”里了 它有一个我不知道如何解决的问题:
如果Windows位于另一个虚拟桌面中,则此程序无法运行。
这里出现了另一个问题:如何将窗口发送到当前桌面 您可以使用
xwininfo
获取窗口id使用此程序调用Eclipse的一个小脚本:
看起来你已经运行了vnc-为什么不再次尝试连接,它应该会在你停止的地方恢复。这就是这个线程的全部要点。。。它不会回来了。。
/home/mclouti% top
top - 08:32:31 up 43 days, 13:06, 29 users, load average: 0.56, 0.79, 0.82
Tasks: 447 total, 1 running, 446 sleeping, 0 stopped, 0 zombie
Cpu(s): 6.0%us, 0.7%sy, 0.0%ni, 92.1%id, 1.1%wa, 0.1%hi, 0.1%si, 0.0%st
Mem: 3107364k total, 2975852k used, 131512k free, 35756k buffers
Swap: 2031608k total, 59860k used, 1971748k free, 817816k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13415 mclouti 15 0 964m 333m 31m S 21.2 11.0 83:12.96 eclipse
16040 mclouti 15 0 2608 1348 888 R 0.7 0.0 0:00.12 top
31395 mclouti 15 0 29072 20m 8524 S 0.7 0.7 611:08.08 Xvnc
2583 root 20 0 898m 2652 1056 S 0.3 0.1 139:26.82 automount
28990 postgres 15 0 13564 868 304 S 0.3 0.0 26:33.36 postgres
28995 postgres 16 0 13808 1248 300 S 0.3 0.0 6:54.95 postgres
31440 mclouti 15 0 3072 1592 1036 S 0.3 0.1 6:01.54 gam_server
1 root 15 0 2072 524 496 S 0.0 0.0 0:03.00 init
2 root RT -5 0 0 0 S 0.0 0.0 0:04.53 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:01.72 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root RT -5 0 0 0 S 0.0 0.0 0:04.33 migration/2
9 root 34 19 0 0 0 S 0.0 0.0 0:00.05 ksoftirqd/2
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
{
if ( argc != 2 ) {
printf("Usage:\n\ttotop <window id>\n");
return 1;
}
Display *dsp = XOpenDisplay(NULL);
long id = strtol(argv[1], NULL, 16);
XRaiseWindow ( dsp, id );
XSetInputFocus ( dsp, id, RevertToNone, CurrentTime );
XCloseDisplay ( dsp );
return 0;
}
$ c++ totop.cpp -L/usr/X11R6/lib -lX11 -o totop
#!/bin/bash
if ps -A | grep eclipse; then # if Eclipse already launched
id=$(xwininfo -name "Eclipse" | grep id: | awk "{ print \$4 }")
totop $id
else # launch Eclipse
eclipse
fi