How to start windows program from WSL Ubuntu Xterm in foreground (on top of all other programs)? - cygwin

I use git and invoke git difftool command from Xterm (that Xterm "runs" WSL shell). My difftool command is set up to start p4merge Windows application.
Everything works alright, but p4merge's window is displayed under all currently visible windows. Specifically, under the Xterm window that started it.
This drives me a bit nuts because if I need to diff 20 files, then I need to Alt+Tab 20 times manually.
I've just migrated from Cygwin to WSL and this exact setup started p4merge on top of all other windows in Cygwin.
So, how do I make WSL start a program and make sure that its window is topmost?

Related

Terminal resize issue with Intellij and Git for Windows SDK

I am on Windows running Intellij and Git for Windows SDK for a feature rich terminal on Windows (pacman, oh my zsh, etc...)
I looked up previously on which command to use to make it the default Intellij Terminal and SO delivered:
How can I launch git-for-windows SDK's git-bash in Windows Terminal?
I am using the cmd from above's 2nd post:
C:\git-sdk-64\msys2_shell.cmd -defterm -here -no-start -mingw64
Everything works fine except for a stubborn resizing issue :
Every time I resize the Intellij Terminal, the MSYS terminal stops receiving key strokes and I have to reopen a new one:
( can't type after the resize under the echo hello )
Trying to avoid WSL for now as I noticed maven builds through wsl were noticeably slower than directly on powershell or via git terminal.
Workaround
Not exactly a solution but if you run with MinGW32, the resize no longer causes the problem
To be seen if I will suffer from other 32/64 bit incompatibilities
using for now:
C:\git-sdk-64\msys2_shell.cmd -defterm -here -no-start -mingw32

visual studio code is not launching in linux even though it is in the path

visual studio code is not launching in linux even though it is in the path
I tried "code ." and expect to open the vscode for the current folder
export DISPLAY=:0 made my day
My Display was not set.It was unset while doing other debugging. reverting it make the window app launch from terminal.
DISPLAY is part of your linux serverx, usually the linux terminal doesn't support launching the window applications from terminal until the display is configured. so it is essential to make sure you have the right config for your DISPLAY arg for your serverx

How do you make xterm work on Cygwin to use IRAF?

I need to use IRAF for astronomy labs, I’m attending remotely so I need to do it with my laptop. I installed Cygwin with the needed packages and IRAF but I don’t understand why when I try to open a terminal with xterm I just get a black window that crashes after a few seconds.

Launching custom desktop from command line with Ubuntu 13.04

I am trying to learn Linux, especially the cli and I have customized my grub file and replaced "quiet splash" with "text".
This has given me the ability to launch Ubuntu into cli only mode. When I run the startx command it launches a blank/default desktop. Is it possible to launch the same desktop I would see if left the "quiet splash" value in place.
In other words can I launch the desktop complete with the sidebar, time, short cuts and other stuff?
Try this command instead of startx in the command line.
# unity

Attach/Detach to a remote instance of Eclipse

When using Eclipse over X-Windows on a remote shell (X port forwarding), is there a way to simply detach my X connection and come back to the process later. For a little more clarity, I'm on a Windows machine and have to reboot. I'd like to keep Eclipse running and come back where I left off. Eclipse is running on my Windows machine through an X-Server connected to a Linux box.
I'm thinking something like tmux could do the trick. However, I do a Ctrl-Z to stop Eclipse and it won't close the Eclipse Window. If I restart the X-Server in Windows, Eclipse fails when I try fg 1. Any other options?
Xpra did everything that I needed, but it was not clear exactly how it worked. I was able to get it working by opening two PuTTY sessions in windows, one server and one client. Also, the Google Code is out-dated. Instead, install from http://xpra.devloop.org.uk/dists/xpra-0.0.7.9.tar.bz2. I'm not sure how it's different, but it worked for me. The README tells how to build the package. It is necessary to apt-get a bunch of other stuff. But, here are the missing pieces on how to get it work as I describe above:
Setup server:
cd ~/download/xpra/xpra-0.0.7.9
export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
./install/bin/xpra start :10
export DISPLAY=:10
xterm&
Setup client:
cd ~/download/xpra/xpra-0.0.7.9
export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
./install/bin/xpra attach :10
Notes:
The Windows xpra installer is not needed for this configuration. I don't know what it's supposed to do.
Be sure to run Xming on Windows.
Be sure to enable X port forwarding on the client PuTTY window.
Launch whatever you want from the xterm window. (ie Eclipse)
You can close the server window once xterm is up.
Hit ctrl-c in the client window to detach from the session.
Do all the client commands again to re-attach..even after restarting PuTTY, the Xming, or Windows itself.
I have zero experience with it, but xpra sounds like exactly what you're looking for.

Resources