pixi icon indicating copy to clipboard operation
pixi copied to clipboard

bug(global): bad vim in pycharm terminal

Open Awenforever opened this issue 2 months ago • 5 comments

Checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Commands I ran in powershell to reproduce the issue:

pixi init test
cd test
pixi add vim
pixi remove vim
pixi global install vim
vim  # everything works fine

And then run command vim in Pycharm terminal Local:

vim  # 1. Mouse movement, clicks, and scroll wheel actions are all treated as input in Vim, resulting in a large amount of garbled characters. 2. Cursor mode anomaly: Characters that the cursor passes over mysteriously "disappear". I know they still exist, but they are no longer visible in the terminal.

pixi global list output:

PS C:\Users\king_\Desktop\test> pixi global list
Global environments as specified in 'C:\Users\king_\.pixi\manifests\pixi-global.toml'
└── vim: 9.1.1858
    └─ exposes: install, tee, uninstall, vim, vimrun, xxd

vim file _viminfo:

# This viminfo file was generated by Vim 9.1.
# You may edit it if you're careful!

# Viminfo version
|1,4

# Value of 'encoding' when this file was written
*encoding=utf-8


# hlsearch on (H) or off (h):
~h
# Last Search Pattern:
~Msle0~/((\*\*

# Last Substitute Search Pattern:
~Msle0&)&

# Last Substitute String:
$~

# Command Line History (newest to oldest):
:q!
|2,0,1761705995,,"q!"
:)
|2,0,1761705992,,")"
:*
|2,0,1761705992,,"*"
:s
|2,0,1761705989,,"s"
:'<,'>!
|2,0,1761705984,,"'<,'>!"
:q
|2,0,1761670033,,"q"
:wq
|2,0,1761656729,,"wq"

# Search String History (newest to oldest):
? ((\*\*
|2,1,1761705993,,"((\\*\\*"
? (
|2,1,1761705993,,"("
? \*
|2,1,1761705993,,"\\*"
? (\*\*
|2,1,1761705992,,"(\\*\\*"
? \*!(
|2,1,1761705992,,"\\*!("
? \*!
|2,1,1761705992,,"\\*!"
??*
|2,1,1761705992,63,"*"
? \*!\*
|2,1,1761705992,,"\\*!\\*"
? !
|2,1,1761705992,,"!"
? \*\*
|2,1,1761705991,,"\\*\\*"
? \*\*!\*
|2,1,1761705991,,"\\*\\*!\\*"
? !\*
|2,1,1761705991,,"!\\*"
? !%
|2,1,1761705991,,"!%"
? &
|2,1,1761705987,,"&"
? %
|2,1,1761705985,,"%"
? &\*\*
|2,1,1761705984,,"&\\*\\*"
? "%
|2,1,1761705984,,"\"%"
? '
|2,1,1761705983,,"'"
? \*\*\*
|2,1,1761705983,,"\\*\\*\\*"
? \*\*\*\*
|2,1,1761705983,,"\\*\\*\\*\\*"
? )&
|2,1,1761705183,,")&"
? )
|2,1,1761705183,,")"

# Expression History (newest to oldest):

# Input Line History (newest to oldest):

# Debug Line History (newest to oldest):

# Registers:
""1	LINE	0
	( ((** !% * &
|3,1,1,1,1,0,1761705993,"( ((** !% * &"
"2	LINE	0
	*!*
|3,0,2,1,1,0,1761705991,"*!*"
"3	LINE	0
	"% &** &
|3,0,3,1,1,0,1761705984,"\"% &** &"
"4	LINE	0
	**
|3,0,4,1,1,0,1761705983,"**"
"5	LINE	0
	*
|3,0,5,1,1,0,1761670022,"*"
"6	LINE	0
	
|3,0,6,1,1,0,1761670021,""
"7	CHAR	0
	&
|3,0,7,0,1,0,1761670021,"&"
"-	CHAR	0
	(
|3,0,36,0,1,0,1761705992,"("

# File marks:
'0  6  12  ~\Desktop\test\pixi.toml
|4,48,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
'1  6  20  ~\Desktop\test\pixi.toml
|4,49,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
'2  15  71  ~\Desktop\test\pixi.toml
|4,50,15,71,1761656615,"~\\Desktop\\test\\pixi.toml"
'3  12  71  ~\Desktop\test\pixi.toml
|4,51,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
'4  15  71  ~\Desktop\test\pixi.toml
|4,52,15,71,1761656615,"~\\Desktop\\test\\pixi.toml"
'5  12  71  ~\Desktop\test\pixi.toml
|4,53,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"

# Jumplist (newest first):
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  12  ~\Desktop\test\pixi.toml
|4,39,6,12,1761656729,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  6  20  ~\Desktop\test\pixi.toml
|4,39,6,20,1761656686,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  15  71  ~\Desktop\test\pixi.toml
|4,39,15,71,1761656648,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  12  71  ~\Desktop\test\pixi.toml
|4,39,12,71,1761656615,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"
-'  1  0  ~\Desktop\test\pixi.toml
|4,39,1,0,1761656198,"~\\Desktop\\test\\pixi.toml"

# History of marks within files (newest to oldest):

> ~\Desktop\test\pixi.toml
	*	1761656726	0
	"	6	12
	^	6	11
	.	6	10
	+	15	72
	+	14	17
	+	6	10

Issue description

Known attempts to resolve the issue:

  • Completely uninstalling Pixi, deleting all Pixi workspaces, and reinstalling Pixi, then running pixi global install vim does not solve the problem.
  • Completely uninstalling PyCharm—including removing all cache and configuration files—and running Vim does not solve the problem.
  • Uninstalling both Pixi and PyCharm and reinstalling them does not solve the problem either.
  • While creating a _vimrc file may help alleviate the issue, it does not fully restore Vim to its default configuration.

_vimrc file i used:

" Enable enhanced mode
set nocompatible

set mouse=a

" Cursor shape when entering Insert mode
let &t_SI.="\e[5 q"

" Cursor shape when entering Replace mode
let &t_SR.="\e[3 q"

" Cursor shape after exiting Insert or Replace mode and entering Normal mode
let &t_EI.="\e[1 q"

" Set cursor shape for Normal mode when Vim starts
autocmd VimEnter * silent !echo -ne "\e[1 q"

" Restore cursor shape for shell mode after leaving Vim
autocmd VimLeave * silent !echo -ne "\e[5 q"

Expected behavior

Vim should function normally in Pycharm terminal, similar to its behavior in PowerShell.

Since managing environments directly in the IDE is more convenient for the majority of users, requiring them to open a separate PowerShell window and change directories is less ideal.

Awenforever avatar Oct 29 '25 03:10 Awenforever

hey @Awenforever ! Thanks for reporting this issue!

Could I ask you, please, to try to reproduce it with conda install ( as I don't have a Windows machine)? My intuition is that maybe it's something wrong with the Vim build of the conda package, or maybe our trampoline is breaking something ( as @tdejager hinted )

nichmor avatar Oct 29 '25 08:10 nichmor

Yeah and try if a non-conda vim install does not do exhibit the same behavior.

tdejager avatar Oct 29 '25 09:10 tdejager

Thank you for the suggestion!

To clarify, my testing was conducted in a completely clean environment—specifically, after a full system reinstall. I found that installing Vim via conda does indeed lead to the same issue within PyCharm, and the problem also occurs when Vim is installed using the Windows package installer.

However, it's important to note that the appearance of this issue depends on certain conditions (though the underlying cause is still unclear):

  • In pixi environments:

    • If Vim is initially installed in the global environment, there is no problem.
    • If Vim is then uninstalled from global and installed in the workspace environment, it still works fine.
    • However, once Vim is uninstalled from the workspace, any subsequent installation—regardless of environment—will result in the issue appearing.
  • In conda environments:

    • No matter where Vim is installed, its behavior in PyCharm is always abnormal.

This pattern suggests that the problem is related to the installation sequence and environment context, but the root cause remains to be determined.

Awenforever avatar Oct 30 '25 15:10 Awenforever

In pixi environments:

  • If Vim is initially installed in the global environment, there is no problem.
  • If Vim is then uninstalled from global and installed in the workspace environment, it still works fine.
  • However, once Vim is uninstalled from the workspace, any subsequent installation—regardless of environment—will result in the issue appearing.

If vim is installed directly in the workspace, without being installed in the global env prior to that, does the issue appear?

nichmor avatar Oct 30 '25 15:10 nichmor

No, it won't.

In fact, it was because I wasn’t very familiar with pixi at first that I installed vim in the workspace. Later, I found that I couldn’t use the command elsewhere, so I tried uninstalling it and reinstalling it in the global environment, which is when I encountered the issue. Afterwards, I set up a new Windows system in a virtual machine and was able to reproduce and test the problem multiple times.

Awenforever avatar Oct 30 '25 16:10 Awenforever

Since you were able to reproduce with conda I think this is an issue with how vim is package. I suggest you create an issue in the vim feedstock.

baszalmstra avatar Nov 21 '25 13:11 baszalmstra