SBT tasks / commands just provide random letters of the command

已回答

IntelliJ IDEA 2024.1.1 (Ultimate Edition) / Windows 11

When using SBT Shell to run sbt commands, ex. compile, test etc. I only get randoms letters of the word - and not the command.

 

Here i wrote “compile” then pressed enter, ends up with “cpil”

 

Running this I get

 

 

It basically makes me unable to use SBT commands inside IDEA, which I find useful.

1

Hello, Petter!

Thank you for reporting this!

Does the regular sbt shell (ran from IDEA"s Terminal or OS Command Prompt) work as intended?

Could you please share the full output from IDEA's sbt shell and a screenshot of the sbt settings?

0

Hi, the first image is SBT Shell in IDEA.

Intellij => Terminal → sbt compile works fine

Windows CMD terminal → sbt compile works fine.

 

This is the initial output in sbt shell before I start writing:

C:\Users\yh96\.jdks\openjdk-22.0.1\bin\java.exe -server -Xmx1536M -Dsbt.supershell=false -Dgrouping.with.qualified.names.enabled=true -Didea.managed=true -Dfile.encoding=UTF-8 "-Didea.installation.dir=C:\Program Files\JetBrains\IntelliJ IDEA 2024.1.1" -Dsbt.log.noformat=true -Dsun.stdout.encoding=windows-1252 -Dsun.stderr.encoding=windows-1252 -jar C:\Users\yh96\AppData\Roaming\JetBrains\IntelliJIdea2024.1\plugins\Scala\launcher\sbt-launch.jar early(addPluginSbtFile=\"\"\"C:\Users\yh96\AppData\Local\Temp\idea1.sbt\"\"\") "; set ideaPort in Global := 55617 ; idea-shell"
[info] welcome to sbt 1.10.0 (Oracle Corporation Java 22.0.1)
[info] loading settings for project course-catalog-build from plugins.sbt,idea1.sbt ...
[info] loading project definition from C:\git\course-catalog\project
C:\git\course-catalog\build.sbt:32: warning: method sonatypeRepo in class ResolverFunctions is deprecated (since 1.7.0): Use sonatypeOssRepos instead e.g. `resolvers ++= Resolver.sonatypeOssRepos("snapshots")`
 Resolver.sonatypeRepo("public"),
          ^
C:\git\course-catalog\build.sbt:33: warning: method sonatypeRepo in class ResolverFunctions is deprecated (since 1.7.0): Use sonatypeOssRepos instead e.g. `resolvers ++= Resolver.sonatypeOssRepos("snapshots")`
 Resolver.sonatypeRepo("releases"),
          ^
C:\git\course-catalog\build.sbt:34: warning: method sonatypeRepo in class ResolverFunctions is deprecated (since 1.7.0): Use sonatypeOssRepos instead e.g. `resolvers ++= Resolver.sonatypeOssRepos("snapshots")`
 Resolver.sonatypeRepo("snapshots"),
          ^
C:\git\course-catalog\build.sbt:51: warning: method in in trait ScopingSetting is deprecated (since 1.5.0): `in` is deprecated; migrate to slash syntax - https://www.scala-sbt.org/1.x/docs/Migrating-from-sbt-013x.html#slash
   parallelExecution in Test     := false,
                     ^
C:\git\course-catalog\build.sbt:11: warning: method in in trait ScopingSetting is deprecated (since 1.5.0): `in` is deprecated; migrate to slash syntax - https://www.scala-sbt.org/1.x/docs/Migrating-from-sbt-013x.html#slash
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }
           ^
[info] loading settings for project root from build.sbt ...
[info] set current project to CourseCatalogService (in build file:/C:/git/course-catalog/)
[info] Installing the s3:// URLStreamHandler via java.net.URL.setURLStreamHandlerFactory
[info] Creating a new Ivy URLHandlerDispatcher to handle s3:// URLs
[warn] there's a key that's not used by any other settings/tasks:
[warn]
[warn] * root / parallelExecution
[warn]   +- C:\git\course-catalog\build.sbt:50
[warn]
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] Defining Global / ideaPort
[info] The new value will be used by Compile / compile, Test / compile
[info] Reapplying settings...
[info] set current project to CourseCatalogService (in build file:/C:/git/course-catalog/)

 

 

0

Thank you for sharing the details!

This appears to be a rather unique behavior, I have not been able to reproduce yet.

Please try the following options:

  1. Disable the downloaded Plugins (backup disabled_plugins.txt, Settings → Plugins → Cogwheel Icon → Disable All Downloaded Plugins)
  2. Revert to the default settings (backup the settings: File → Manage IDE Settings → Export Settings…, reset to defaults: File → Manage IDE Settings → Restore Default Settings…)
  3. File → Repair IDE
0

I am getting the same now, Intellij release and EAP, Scala plugin release, early and nightly.

Only through SBT shell in Intellij.

I've tried “Disabling” and enabling just Scala, default settings and repairing IDE.

0

Andrzej Grzesik Thank you for reporting this!

Could you please share:

  • A brief screencast demonstrating the issue as it manifests in your environment
  • IDEA's logs (Help → Collect Logs and Diagnostic Data)
  • A screenshot of your current sbt Settings

so we can investigate this further?

You can share the items listed above using our upload service, please post the Upload ID here.

0

There are screenshots in SCL-23277.

0

Andrzej Grzesik Thank you for submitting the YouTrack Issue!

Scala R&D Team will be looking into it shortly.

0

Hello! I'm sorry for a delay in responding.
There exists an issue for this problem: https://youtrack.jetbrains.com/issue/SCL-22878/Broken-completion-for-sbt-shell-when-using-windows-and-JDK-22 

Please, vote for it.
As a workaround, I suggest changing the JDK version of the project if it is possible in your case.

0

请先登录再写评论。