-
|
hello all and greetings, I am observing this weird behaviour with Windows Terminal (PowerShell profile) since quite some time that when my last run command is ssh (ssh -i C:\Users\user\Documents\ssh.key eon@10.10.10.10) and when I close the ssh connection OR reopen windows terminal and press up arrow key to access my last run ssh command (from saved history), it doesnt show up at all. However, all the other normal commands do show up as usual when I access them via up arrow key on empty terminal which were last ran. So, I just want to understand if Windows Terminal have special casing to not store ssh commands in terminal history but it stores other commands just fine? and how do I fix it so if my last run command is ssh cmd and when I reopen terminal or try to access it via up arrow key, it is available there? My Terminal settings.json {
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"id": "User.copy.644BA8F2"
},
{
"command": "paste",
"id": "User.paste"
},
{
"command": "find",
"id": "User.find"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"id": "User.splitPane.A6751878"
}
],
"copyFormatting": "none",
"copyOnSelect": true,
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"keybindings":
[
{
"id": "User.copy.644BA8F2",
"keys": "ctrl+c"
},
{
"id": "User.find",
"keys": "ctrl+shift+f"
},
{
"id": "User.paste",
"keys": "ctrl+v"
},
{
"id": "User.splitPane.A6751878",
"keys": "alt+shift+d"
}
],
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults":
{
"colorScheme": "One Half Dark",
"cursorShape": "filledBox",
"font":
{
"face": "JetBrainsMono Nerd Font",
"size": 10
}
},
"list":
[
{
"antialiasingMode": "cleartype",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"historySize": 11111,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"hidden": false,
"name": "Git Bash",
"source": "Git"
}
]
},
"schemes": [],
"tabWidthMode": "equal",
"themes": [],
"useAcrylicInTabRow": true
}please let me know if I need to provide anything else which I might've missed. P.S. I have done search for "ssh" and "ssh history" in open discussions but it shows many results, I went and looked at some but they did not feel relevant to my issue. I'm not sure what other keywords to search for to find similar discussions to my own. I apologise! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Just passing through. |
Beta Was this translation helpful? Give feedback.
-
|
This is PowerShell's "intelligent" history at work. It is excluding the command from history because it contains the word |
Beta Was this translation helpful? Give feedback.


Hmm. You can override the default history handler with one that just always says "yup save it to history."
You'd need to add that to your
$PROFILEto get it to stick.