Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PowerShell: Command history is not available using up and down arrows #9

Open
philibertperusse opened this issue Nov 6, 2023 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@philibertperusse
Copy link

When inside inshellisence, using up or down arrows will not bring up commands from the command history.

Applicable to PowerShell, not tested with bash or other shells.

@cpendery
Copy link
Member

cpendery commented Dec 5, 2023

Closing as this was fixed in 0.0.1-rc.5

@cpendery cpendery closed this as completed Dec 5, 2023
@assiless
Copy link

assiless commented Oct 26, 2024

node: v20.18.0
inshellisense: 0.0.1-rc.16
powershell

Name Value
PSVersion 5.1.19041.5007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.5007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

it stuck in

cd ~\Developer\intro-to-react-by-day\day-10-ts\ ; bun run dev

Image

This Might Help:

  • if i add trailing spaces in ConsoleHost_history.txt file after run dev it's doesn't stuck
  • but trailing spaces doesn't always help eg:
    1. with trailing spaces code --user-data-dir="${HOME}/.vscode-root" ❌ stuck
    2. without trailing spaces code --user-data-dir="${HOME}/.vscode-root" ❌ stuck
    3. with .exe code.exe --user-data-dir="${HOME}/.vscode-root" ✔ doesn't stuck

@cpendery is there a workaround like

[bindings.previousSuggestion] 
key = "up"
ctrl = true

this is really annoying

@cpendery cpendery reopened this Nov 7, 2024
@cpendery cpendery modified the milestones: November 2023, 0.0.1-rc.19 Nov 8, 2024
@cpendery
Copy link
Member

cpendery commented Nov 9, 2024

node: v20.18.0 inshellisense: 0.0.1-rc.16 powershell

Name Value
PSVersion 5.1.19041.5007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.5007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
it stuck in

cd ~\Developer\intro-to-react-by-day\day-10-ts\ ; bun run dev
Image Image

This Might Help:

  • if i add trailing spaces in ConsoleHost_history.txt file after run dev it's doesn't stuck

  • but trailing spaces doesn't always help eg:

    1. with trailing spaces code --user-data-dir="${HOME}/.vscode-root" ❌ stuck
    2. without trailing spaces code --user-data-dir="${HOME}/.vscode-root" ❌ stuck
    3. with .exe code.exe --user-data-dir="${HOME}/.vscode-root" ✔ doesn't stuck

@cpendery is there a workaround like

[bindings.previousSuggestion]
key = "up"
ctrl = true
this is really annoying

I can't replicate this on 0.0.1-rc.16. Can you try on 0.0.1-rc.18 and run inshellisense with the -V option? The logs will be at ~/.inshellisense/inshellisense.log and it would help alot if you could provide them here

@assiless
Copy link

  • the bug was caused by putting plugging at top of "C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1"
  • putting plugging at the end of file solve the issue
# ---------------- inshellisense shell plugin ----------------
$__IsCommandFlag = ([Environment]::GetCommandLineArgs() | ForEach-Object { $_.contains("-Command") }) -contains $true
$__IsNoExitFlag = ([Environment]::GetCommandLineArgs() | ForEach-Object { $_.contains("-NoExit") }) -contains $true
$__IsInteractive = -not $__IsCommandFlag -or ($__IsCommandFlag -and $__IsNoExitFlag)
if ([string]::IsNullOrEmpty($env:ISTERM) -and [Environment]::UserInteractive -and $__IsInteractive) {
  is -s powershell
  Stop-Process -Id $pid
}
# end of file

nb: but this bug still occurs with git-bash-windows "C:\Program Files\Git\etc\bash.bashrc" for 0.0.1-rc.16 and 0.0.1-rc.18

# ---------------- inshellisense shell plugin ----------------
if [[ -z "${ISTERM}" && $- = *i* && $- != *c* ]]; then
	shopt -q login_shell
	login_shell=$?
	if [ $login_shell -eq 0 ]; then
		is -s bash --login ; exit
	else
		is -s bash ; exit
	fi
fi
# end of file

@cpendery cpendery modified the milestones: 0.0.1-rc.19, 0.0.1 Dec 31, 2024
@FlashAmarillo
Copy link

I would like to report and add another very similar problem in this discussion, the problem is that you cannot delete the whole word when pressing Ctrl + delete key. This happens when the inshellisense session is live, you can only delete one letter at a time, I noticed this in my powershell terminal using windows 11.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants