Is there a keyboard shortcut to restart the current console in cmder? - cmder

It seems like there is with ConEmu https://conemu.github.io/en/KeyboardShortcuts.html "Win+~" but a way to restart the current console in cmder would be great.
Cheers

Go to Settings - Main - Keys & Macro
Then select "Recreate active console" from the list and set hotkey for it.
This action will show a dialog with three buttons: Restart, Terminate, Cancel. Restart is a default button and you can choose it by just pressing ENTER key.

According to the current help of cmder:
Recreate(<Action>[,<Confirm>[,<AsAdmin>]]), alias "Create"
- Create new tab or restart existing one
Action: 0 - create tab, 1 - restart tab, 2 - create window
Confirm: 1 - show ‘Create new console’ dialog, 0 - don't show
AsAdmin: 1 - start elevated tab
Open Settings - Keys & Macros - Select Macros from dropdown - use one of the unused Macro places (input macro into GUI Macro)
Example:
Recreate(1, 0, 1)
Restart Tab - do not show confirmation window - start as admin

Related

How to use AppleScript or Lua to do an ALT + TAB after results on the Calculator.app

I use the Calculator.app, and after hitting the ENTER key, I would like it to automatically do an ALT + TAB to go to the previous App I was using: Excel or Firefox or Chrome, ... you name it.
I have the same question for just .lua, but if it can't be done with .lua I'd like to do it with AppleScript or with the Automator.
What's the hot key for TAB in .lua? hammerspoon?
UPDATE:
As user3439894 says, CMD + TAB works fine.
But in my end, the TAB is not released, therefore, I keeps on showing all the open apps. So, I tried to put a RETURN as of the documentation. I also tried ENTER , but non of them work.
hs.eventtap.keyStroke({"cmd"}, "tab")
hs.eventtap.keyStroke({"return"})
-- hs.eventtap.keyStroke({"enter"})
Assuming your are using this in conjunction of one of the answers I gave you back in mid November regarding Calculator, then the modified Lua code below works for me to switch to the previous application when pressing the enter key while in Calculator.
Example Lua code:
-- Create a hotkey used to trap the enter key and disable it.
-- It will then be enabled/disabled as Calculator is focused/unfocused
-- When enabled and the enter key is pressed it presses = then command C.
applicationCalculatorEnterHotkey = hs.hotkey.bind({}, "return", function()
-- Press the '=' key to finish the calculation.
hs.eventtap.keyStroke({}, "=")
-- Copy the result to the clipboard.
hs.eventtap.keyStroke({"cmd"}, "C")
-- Bring up the App Switcher.
hs.eventtap.keyStroke({"cmd"}, "tab")
-- Act on the selected App in the App Switcher.
-- This works in testing with Calculator, however
-- may not work in other applications.
hs.eventtap.keyStroke({}, "=")
end)
applicationCalculatorEnterHotkey:disable()
Notes:
I've added two hs.eventtap.keyStroke to the original code with comments.
Executing hs.eventtap.keyStroke({"cmd"}, "tab") in the Console Hammerspoon does automatically switch to the previous application without showing the App Switcher, however when used in the applicationCalculatorEnterHotkey function it shows the App Switcher as if ⌘-Tab has been pressed and the ⌘ key not released. This may be a bug, not sure as not enough testing/research into the issue was done as the obvious solution would be to follow up with programmatically pressing the enter key, however that can not be done from within the applicationCalculatorEnterHotkey function because it is already trapping the enter key in Calculator.
In this particular use case, however this is where hs.eventtap.keyStroke({}, "=") is used to act as if the enter key had been pressed again and is unique to Calculator.

Bind multiple actions to one key in lighttable

I'm using the vim plugin in lighttable.
When I'm in insert-mode and press ESC while a code completion window is shown, it closes that window but doesn't exit insert mode.
I'd like lighttable to do both at the same time when pressing ESC because I got so used to it in plain vim.
I've tried to bind ESC to both of those actions:
[:app "esc" [
:auto-complete.remove
:vim.send-key "esc"
]
]
But this doesn't work. Is this even possible? Is there another workaround for that problem?
You should be able to do this by adding the following to your user.keymap file:
[:editor "esc" :auto-complete.remove (:vim.send-key "<Esc>")]
But this isn't currently possible.
I created an issue for this on GitHub for the LT Vim plugin repo. 'Fixing' this is relatively minor change to CodeMirror upstream of LT. I'll update this answer again if any other progress is made.

Standard print button is inoperative in custom Report

My customer has reported a problem that standard ''print'' button in Z-report which a developer wrote before is not working.
How can I enable the button?
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
ENDCASE.
ENDMODULE.
Then button needs a usercommand assigned, which is then processed in pai. usually with a general form called get_ucomm (many developers call it similar). You also can issue /h in transaction field and then press the print-button. /h will trigger the debugger and You can inspect the report step by step.
That's all I can say without seeing the code. Hope this will help.
Which user command do you define in your GUI status?
If you have a standard list (what I expect when you write about a z-report), then you should define the command PRI to print the list:
If you define a screen (using the screen painter) or an ALV-Grid... then this solution will not help you.
If you don't know, what a GUI status is: Scan your source code for the command
SET PF-STATUS 'XXXX'.
Then double click on 'XXXX' and you should be directed to the status definition. There may by multiple status (and status with generic names).
I've seen your code and for the &RNT option there's no code to execute, so if the user wants to print the button will do nothing.
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
" There's no code
ENDCASE.
ENDMODULE.
I've used the 'STANDARD' GUI Status from the function group 'KKBL' and '&RNT' is the code of the print button and that's why I think that is the print button you are refering in your program.
Can you post the GUI Status you are using please?

Pre-Action run script to clear the simulator's Application Support directory

I am running automated UI tests that depend on a clean build for every run.
I'd like to add a pre-action run script that clears out anything in the Application Support directory (e.g. /Users/username/Library/Application Support/iPhone Simulator/7.1/Applications/58A5DCF7-689B-4D13-B178-A88CDE33512/Library/Application Support)
Is there an Xcode variable that makes it easy to get to that directory? Anything like $(BUILD_DIR)?
Here is what works for me:
#!/bin/bash
# `menu_click`, by Jacob Rus, September 2006
#
# Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
# Execute the specified menu item. In this case, assuming the Finder
# is the active application, arranging the frontmost folder by date.
osascript <<SCRIPT
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on
set {appName, topMenu} to (items 1 through 2 of mList)
set r to (items 3 through (mList's length) of mList)
-- This overly-long line calls the menu_recurse function with
-- two arguments: r, and a reference to the top-level menu
tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
(menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
end menu_click
on menu_click_recurse(mList, parentObject)
local f, r
-- `f` = first item, `r` = rest of items
set f to item 1 of mList
if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
-- either actually click the menu item, or recurse again
tell application "System Events"
if mList's length is 1 then
click parentObject's menu item f
else
my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
end if
end tell
end menu_click_recurse
application "iPhone Simulator" activate
menu_click({"iPhone Simulator", "iOS Simulator", "Reset Content and Settings…"})
tell application "System Events"
tell process "iPhone Simulator"
tell window 1
click button "Reset"
end tell
end tell
end tell
SCRIPT
Taken from: https://stackoverflow.com/a/14811280/1041311
Also note that it wonk work for the first time, since you need to allow Xcode to modify folders. At first run there will be dialog which will take you to System preferences where you need to give Xcode that permissions.

Keyboard shortcuts for Compare with Latest Version / Compare with Workspace version in Visual Studio 2012

This was easy in VS 2010, but I can't find the right items in VS 2012.
I'd like to set keyboard shortcuts for the Compare With Latest/Workspace Version context menu items in the TFS Pending Changes view. What's the item I should select in the Keyboard section of the Tools dialog?
(This was tested with Visual Studio 2012 Update 1)
Tools > Options > Environment > Keyboard >
Under Show commands containing search and assign key combinations to:
TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithPreviousVersion - compares pending item in context to previous version.
TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithLatestVersion - compares pending item in context to latest version.
TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithWorkspaceVersion - compares pending item in context to workspace version.
File.TfsCompare - open the compare dialog.
For me, this worked:
VS > Tools > Options > Environment > Keyboard > Show Commands Containing: Team.Git.CompareWithUnmodified
By assigning a shortcut key Ctrl+\, Ctrl+\ to this command ( Team.Git.CompareWithUnmodified) I can now compare my current file (the file that is open in the editor) to the previous version of the file by pressing the shortcut key Ctrl+\, Ctrl+\; no need to find the file in solution explorer, then right-click the file then select Compare.
(you can choose your own shortcut key of course)
Just a note on different behaviour:
Team.Git.CompareWithUnmodified works for me because I am using TeamExplorer in VisualStudio but I use GIT as the underlying source code repository.
Tfs.FileCompare could also work in other scenarios (i.e. if you don't use Git, but use VSTS or TFS as your source control provider).
Other: the command will be different if you use another source control provider.
While you have the file open use this combo to compare with Workspace version:
Menu, O, C, Enter
(This performs Right Click > Source Control > Compare > Workspace Version)
If your keyboard doesn't have a Menu key, do this:
Set the hotkey for File.TfsCompare to Ctrl+\ Ctrl+\
Use the combo: Ctrl+[ Ctrl+S Ctrl+\ Ctrl+\ Enter

Resources