jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-58872] Last output line of sh not printed when not terminated with newline

Open
#461 0 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Reproducer:

```
node() {
  sh "printf 'one\ntwo\nthree'"
}

```

prints just:

```
one
two

```

The workaround is to append EOL at the end of the sh output but it can be pretty confusing before diagnosed.

Printing curl response this way has caused only DOCTYPE line to be printed as the rest of Jenkins markup served was on the last single line and thus not shown at all.

---
Originally reported by olivergondza, imported from: Last output line of sh not printed when not terminated with newline


  • status: Open
  • priority: Minor
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

Reproducer:



node() {

  sh "printf 'one\ntwo\nthree'"
}


prints just:



one

two


The workaround is to append EOL at the end of the sh output but it can be pretty confusing before diagnosed.

Printing curl response this way has caused only DOCTYPE line to be printed as the rest of Jenkins markup served was on the last single line and thus not shown at all.

environment

```
Jenkins ver. 2.164.2

durable task 1.29
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.