Skip to content

Commit

Permalink
fix: Remove unneeded withPtty: true from process handler
Browse files Browse the repository at this point in the history
Resolves #253
  • Loading branch information
Roboroads committed May 8, 2023
1 parent c220bb4 commit d337fe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed

- [[#252]](https://github.com/Roboroads/laravel-tinker/issues/252) Cast exception when running on an SSH interpreter
- [[#253]](https://github.com/Roboroads/laravel-tinker/issues/253) Remove unneeded `withPtty: true` from process handler

## [2.6.0] - 2023-04-16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class PhpArtisanTinkerUtil(private val project: Project, private val phpCode: St
val tinkerRunSettings = projectSettings.parseJson()
phpCommandSettings.addArguments(listOf("-r", phpTinkerCodeRunnerCode, phpCode, tinkerRunSettings.toString()))

processHandler = getAnsiUnfilteredProcessHandler(runConfiguration.createProcessHandler(project, phpCommandSettings, true))
processHandler = getAnsiUnfilteredProcessHandler(runConfiguration.createProcessHandler(project, phpCommandSettings))

ProcessTerminatedListener.attach(processHandler, project, "")
} catch (ex: ExecutionException) {
Expand Down Expand Up @@ -144,10 +144,6 @@ class PhpArtisanTinkerUtil(private val project: Project, private val phpCode: St
}

private fun getAnsiUnfilteredProcessHandler(processHandler: ProcessHandler): ProcessHandler {
if (processHandler is KillableProcessHandler) {
return processHandler
}

if (processHandler is OSProcessHandler) {
return KillableProcessHandler(processHandler.process, processHandler.commandLine)
}
Expand All @@ -156,7 +152,7 @@ class PhpArtisanTinkerUtil(private val project: Project, private val phpCode: St
return BaseRemoteProcessHandler(processHandler.process, processHandler.commandLine, processHandler.charset)
}

// Could not find suitable cast, return original
// Could not find suitable cast, return original (colorless, but working) handler
return processHandler
}
}

0 comments on commit d337fe2

Please sign in to comment.