Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

When windows username has a space, powershell terminal fails to initialize #17

Closed
borbmizzet opened this issue Feb 12, 2019 · 1 comment · Fixed by #208
Closed

When windows username has a space, powershell terminal fails to initialize #17

borbmizzet opened this issue Feb 12, 2019 · 1 comment · Fixed by #208
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@borbmizzet
Copy link

When the windows user folder contains a space, the powershell terminal fails to initialize.
Example Username: Fooby Doobar

C:\Users\Fooby : The term 'C:\Users\Fooby' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ C:\Users\Fooby Doobar\AppData\Local\Temp\start-pses-host ...
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\Fooby:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@ForNeVeR ForNeVeR added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Sep 15, 2023
@ForNeVeR
Copy link
Collaborator

Reproduced even without changing my user name using the following patch:

Index: src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt
--- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt	(revision Staged)
+++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt	(date 1694812411864)
@@ -39,7 +39,7 @@
 
 open class EditorServicesLanguageHostStarter(protected val myProject: Project) : LanguageHostConnectionManager {
 
-  private val LOG: Logger = Logger.getInstance(javaClass) 
+  private val LOG: Logger = Logger.getInstance(javaClass)
   private var socket: Socket? = null
   private var myReadPipe: RandomAccessFile? = null
   private var myWritePipe: RandomAccessFile? = null
@@ -208,7 +208,7 @@
         "-LogLevel '$logLevel' -LogPath '$logPath' -SessionDetailsPath '$sessionDetailsPath' -FeatureFlags @() $splitInOutPipesSwitch"
     val scriptText = "${escapePath(startupScript)} $args\n"
 
-    val scriptFile = File.createTempFile("start-pses-host", ".ps1")
+    val scriptFile = File.createTempFile("start pses host", ".ps1")
     scriptFile.deleteOnExit()
     try {
       FileUtil.writeToFile(scriptFile, scriptText)
@@ -415,4 +415,4 @@
   override fun isConnected(): Boolean = myProcess?.isAlive == true
   protected open fun getLogFileName(): String = "EditorServices-IJ-${getSessionCount()}"
   private fun createLogPath(psExtensionPath: String): String = FileUtil.toCanonicalPath("$psExtensionPath/sessions/${getLogFileName()}.log")
-}
\ No newline at end of file
+}

While I am planning to fix the issue, I'd recommend using the ordinary IDE terminal instead of this console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants