Cmder/Conemu: dynamically name tab title from within task definition - conemu

I am using Putty in Cmder to ssh to a 'jumpbox'. I then pass a hostname in a file using the -m ssh option to jump to the 'real' destination host.
I want to dynamically set the title of the putty tab from within a task definition in Cmder/ConEmu to be the hostname I'm jumping to. In the screenshot below you can see that I have attempted to use "%REMOTE_HOST%" to pass in an environment variable containing the title that I want to have on my tab. However this just creates a tab named %REMOTE_HOST%.
Any help would be greatly appreciated.

I explained many times that PuTTY and mintty are not console applications, they are GUI applications with their own graphical interface.
An analogy: you run VirtualBox with Ubuntu (as client) in Windows (as host) and some console application in you VirtualBox-ed Ubuntu. Don't you wonder why TaskBar in Windows does not show the title of Ubuntu console?
When you run ChildGUI in ConEmu it shows in the Tab children window title.
What you need to do
Configure PuTTY or your remote host (e.g. bash prompt with ANSI) to show proper text in PuTTY title. The questsion has nothing to do with ConEmu.
Also, ensure that the tab bar console template in ConEmu/Cmder settings is or contains %s. e.g.

Related

Can I keep vscode Terminal connected to host machine while in Docker environment using Remote Containers extension?

I have the Remote Containers extension setup so I can jump into a docker container for autocomplete etc. That's working how I want it to.
But it also sets the Terminal window to be inside that environment and I want to instead keep the Terminal window connected to my host machine. I can understand why it's useful to have Terminal from inside the container, but it's not useful for my usecase and it breaks some of my testing tools.
There are 2 commands in VS Code to open terminal windows when using Remote Containers extension:
Terminal: Create New Integrated Terminal will open a terminal window within a container.
Terminal: Create New Integrated Terminal (Local) will open a terminal on your host machine.
Latter doesn't seem to have have a key binding assigned, so you may want to add one.

Keyboard shortcut to toggle OUT of a Citrix Workspace Desktop Viewer session

Background
I'm using the Desktop Viewer functionality in Citrix Workspace (version 20.2.0.25(2002)) to access my work computer from my home computer.
Request
I would like to be able to toggle out of my (full-screen) remote session back to my local desktop more easily.
Currently I can only accomplish this via the control bar at the top of the remote session screen which is starting to feel tedious.
Alt+Tab doesn't work, because it only toggles the applications within the remote session when the session is open.
Whether toggling is accomplished via getting Alt+Tab to work as desired, a hotkey that just minimizes the session window, or some other method doesn't matter to me.
What I've Tried
There are many questions online addressing how to enable Alt+Tab within the remote session, but not disable it. Naturally I've tried to do the reverse of these instructions but no luck. They typically suggest setting TransparentKeyPassthrough=Remote in the registry of the local machine, so I figured mine should have Remote already and I would just need to clear it or replace it with something else, but mine is a null value.
I've gone through all options within Citrix Workspace and the Remote session Preferences but there's nothing about enabling/disabling/setting hotkeys.
I tried the "Disable Hotkeys through the ICACLIENT.ADM Template" of this Citrix Support page, but was unable to locate the icaclient template file they refer to.
I've contacted my company's help desk but they don't know of any solutions.
You can access the citrix menu as described here:
As an accessibility feature of the Desktop Viewer, pressing CTRL+ALT+BREAK
displays the Desktop Viewer toolbar buttons in a pop-up window.
So the shortcut for toggling out of the viewer session would be:
CTRL + ALT + BREAK, CURSOR-DOWN, ENTER
I had the same problem and solved it with an Autohotkey script. Autohotkey can intercept keypresses even when citrix has focus.
This script will allow you to get out of your citrix session with Ctrl-F1.
^F1::
WinMinimize, A
return
If you have not used Autohotkey before: Download Autohotkey, install it, save the code above in a file named citrix.ahk, double-click that file. The hotkey is now active and the script is visible as a H icon in your taskbar.
See here if you want to bind a different key.
Unable to comment on ht13's answer so i'll post my own.
CTRL+ALT+BREAK, h
worked for me.
Thankfully i remembered some keyboards have BREAK, some (like mine) call it PAUSE in case you run into that too.
I have a method for this that involves editing the registry on your local machine.
It definitely counts as 'some other method' - essentially, it sets up a keyboard shortcut that (I think) passes the Win-key keystroke to your local machine.
This opens your local start menu on top of Citrix - and from there you can Alt+Tab locally as normal.
Citrix has multiple entries in different parts of the registry, and also some settings that you can change with the Local Group Policy Editor (gpedit). Unfortunately, the only one I've found that helps is 'Hotkey13', which is only available in the registry.
I've changed multiple things, but I believe the minimal necessary steps are this:
open regedit, and navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine\Hot Keys\
ensure the value of AllowHotkey is set to 1
set the value of Hotkey13Shift; I've used Shift, if I recall correctly it accepts Ctrl and Alt and some combinations joined by +
set the value of Hotkey13Char; I've used F1, and think it accepts all Fx keys and possibly some others
restart Citrix, reconnect to your remote desktop, and test your chosen combination
Now, to access my local machine from within a Citrix session I press Shift+F1 to open my local Start menu and give focus to my local machine, and then while it is open Alt+Tab or anything else acts locally.
A screenshot of regedit highlighting Computer\HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine\Hot Keys\Hotkey13Shift
this bothered me for so long and I finally got a fix: (AHK+Virtualdesktop)
put your citrix desktop viewer in a different virtual desktop
install AutoHotKey and Windows-desktop-switcher
https://github.com/vnavkal/windows-desktop-switcher#:~:text=An%20AutoHotkey%20script%20for%20Windows%20that%20lets%20a,desktops%20by%20hotkey%2C%20etc.%20%28see%20Hotkeys%20section%20below%29.
define whatever hotkey you want to use to toggle between different virtual desktop.
it seems the AHK is able to intercept the hotkey BEFORE it is send to the Desktop Viewer.
my setup:
I use a windows desktop and 2 extra display
I put citrix on virtual desktop2, and fullscreen to all 3 screens
use the hotkey to toggle back to laptop host window virtual desktop 1 without any problem.
FN+F11 toggles out to my windows taskbar. Just need to click on the citrix icon on the task bar to go back again.
Press Ctrl+Alt+Fn+B and then W for switching to window or F to get Citrix in full screen mode. A bit faster then using arrows ...
Using SHIFT + F2 you can resize the Citrix window and access the local machine taskbar so that you can easily switch between the apps.
Refer to this link: CTX232298.
I place citrix workspace on separate windows desktop, and use CTRL + ALT + BREAK and then CTRL + WIN + LEFT/RIGHT to switch from it to another desktop.

Findmerge graphical using paramiko

I have a script on a remote clearcase server which I execute using paramiko invoke_shell.The script contains a cleartool findmerge command graphical but the graphical window never opens though I used x11 forwarding. It waits forever.I even added the checkout comments for the merge. I want the graphical window to be opened.
It depends how you did setup your X-forwarding: see this thread for example:
Launch Exceed
Launch Putty
In the putty configuration window, select Connection, then SSH, and then X11 from the left side menus.
On the right side, select the checkbox for Enable X11 forwarding and set the X display location to "localhost:0" .
In the putty configuration window, select Session from the left side.
Enter the hostname of a system to connect to Select the SSH protocol
Save settings by selecting the Save button on the right.
Invoke session by double-clicking on hostname
from the server, run "export DISPLAY=windows ip:0"
You should be able to run any X-based tool or application
e.g. clearprojexp &
The OP Srikar Veeramallu mentions in the comments:
I am in a dynamic view set using cleartool setview
That explains why it "waits forever". A setview will create a sub-shell, which might not benefit from the same X11 forwarding as the main shell.
See "Python and ClearCase setview" for more details.
The workaround is to use the full path of the view.

Linux mint drag & drop files on my program's desktop icon

I am using Linux Mint.
I wrote a small program in C and want to drag and drop a file onto its desktop or caja icon.
When I drag a file over the icon of an installed application, that app icon highlights showing that it will launch, but my program's icon does not highlight. How do I enable the launch?
In windows all programs launch, even if they don't handle a dropped file.
The program "executable" permission is set, and double clicking the icon does launch it.
I am thinking that it is not something I do "in" the program code, but some configuration for the icon or Linux. The program code accepts command line arguments when run from a terminal. But dropping files on its icon does nothing at all except moves the files to the desktop piled on top of the program icon. Never even attempts to launch the program.
What am I missing?
Now I understand!
I must create a "launcher" for the program. This is done by right-clicking on the desktop blank area to get the context menu, and choose "Create Launcher...". Then fill in the fields, and especially the "Command:" field with a valid pathname (or just a name if the program is in a directory that is included in the PATH environment variable). AND include at the end of that command line %F to accept the file(s) to be dropped. Also give it a name and click OK.
If you leave off the %F and drop more than one file, each file will launch its own instance of the program. The %F causes all the files to be passed to one instance of the program. For example if you want to drop two files onto a compare program.
If it doesn't work, you can edit the command and other fields by right-clicking on its icon and choose Properties.
It has a generic springboard icon.
In a terminal, the ls command shows the launch file for "prog" (for example) as prog.desktop but on the desktop just prog. The launcher file can be moved or copied into a folder (other than desktop) and they work the same (although the icon is different).
Hope this helps others.

Batch process does not print with correct font

A WinForms program I have developed prints fine and as expected when run as an interactive user. Using the same account but as a scheduled task, the process will run correctly however it prints part of the output in the incorrect font.
The program is a label printer that prints updated pricing labels. It has an option (-s) that the Task Scheduler calls which does not present the GUI but does an update and prints. Executing this as an interactive user through run works correctly (i.e. the correct font is used).
Any clues as to what's happening here? The font that isn't printing correctly is a non-standard system font.
This runs on a server and I thought it might be due to printer redirection but I did a console logon and it worked fine as an interactive process on the console just as it does as interactive through remote desktop.
Interesting problem. Presumably, Windows doesn't load fonts into the non-interactive logon sessions in order to conserve resources.
See this answer for one approach, using the ps tool to create an interactive session when running the task.
I had a very similar issue to yours (running an application through a scheduled task would use the default font but when running locally it would find the custom font I installed) and I found a solution; On Server 2008, there is an issue where custom fonts are not registered immediately after installing for non-interactive users, whereas regular users (i.e. when running on a user actually logged in to the machine) do have the font registered immediately.
The solution that worked for me was to simply restart the machine the font was installed on and the font started working under the non-interactive accounts, as when the computer is turned on it registers correctly. It appears the font installation has a bug where it doesn't register the font correctly for non-interactive users until a reboot.

Resources