Skip to content

Commit b1ee997

Browse files
authored
Merge branch 'main' into fix/git-worktree-common-dir
2 parents ca0b4da + 23d140c commit b1ee997

15 files changed

Lines changed: 33 additions & 35 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
az storage blob upload-batch --destination releases/latest --overwrite true --source .
155155
az storage blob upload-batch --destination releases/latest --overwrite true --source . --pattern "*.appinstaller" --content-type "application/appinstaller"
156156
- name: Create draft release 📝
157-
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228
157+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64
158158
with:
159159
tag_name: ${{ needs.changelog.outputs.tag }}
160160
body: ${{ needs.changelog.outputs.body }}

src/config/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,9 @@ func (cfg *Config) getPalette() color.Palette {
136136
return palette
137137
}
138138

139-
// streamingEnabled reports whether streaming should be enabled: it's configured, and not
140-
// force-disabled via POSH_DISABLE_STREAMING regardless of that configuration.
141-
func (cfg *Config) streamingEnabled(env runtime.Environment) bool {
142-
return cfg.Streaming > 0 && env.Getenv("POSH_DISABLE_STREAMING") != "1"
139+
// streamingEnabled reports whether streaming should be enabled: it's configured.
140+
func (cfg *Config) streamingEnabled(_ runtime.Environment) bool {
141+
return cfg.Streaming > 0
143142
}
144143

145144
func (cfg *Config) Features(env runtime.Environment) shell.Features {

src/config/config_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ func TestFeaturesShellIntegration(t *testing.T) {
163163

164164
func TestFeaturesStreaming(t *testing.T) {
165165
cases := []struct {
166-
Case string
167-
DisableStreaming string
168-
Streaming int
169-
ExpectedFeats shell.Features
166+
Case string
167+
Streaming int
168+
ExpectedFeats shell.Features
170169
}{
171170
{
172171
Case: "streaming enabled",
@@ -177,18 +176,11 @@ func TestFeaturesStreaming(t *testing.T) {
177176
Case: "streaming not configured",
178177
ExpectedFeats: 0,
179178
},
180-
{
181-
Case: "POSH_DISABLE_STREAMING overrides the config",
182-
Streaming: 100,
183-
DisableStreaming: "1",
184-
ExpectedFeats: 0,
185-
},
186179
}
187180

188181
for _, tc := range cases {
189182
env := &mock.Environment{}
190183
env.On("Shell").Return(shell.PWSH)
191-
env.On("Getenv", "POSH_DISABLE_STREAMING").Return(tc.DisableStreaming)
192184

193185
cfg := &Config{
194186
Streaming: tc.Streaming,

src/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/invopop/jsonschema v0.14.0
1212
github.com/lucasb-eyer/go-colorful v1.4.1
1313
github.com/pelletier/go-toml/v2 v2.4.3
14-
github.com/shirou/gopsutil/v4 v4.26.7
14+
github.com/shirou/gopsutil/v4 v4.26.8
1515
github.com/stretchr/testify v1.12.1
1616
github.com/wayneashleyberry/terminal-dimensions v1.1.0
1717
go.yaml.in/yaml/v3 v3.0.5

src/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t
8585
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
8686
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
8787
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
88-
github.com/shirou/gopsutil/v4 v4.26.7 h1:IXzpHz/dkMRYAhKkOXr1HB6SuzWU3eoyyeWe7g3bNZc=
89-
github.com/shirou/gopsutil/v4 v4.26.7/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM=
88+
github.com/shirou/gopsutil/v4 v4.26.8 h1:YQMTF/1J50B5+Y0vlo1eDRf5DoR7Gk69hY+8wjYkQeo=
89+
github.com/shirou/gopsutil/v4 v4.26.8/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM=
9090
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
9191
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
9292
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=

src/prompt/golden_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const regenerateFixtureCommand = "go run . config export data --sanitize --theme
5353

5454
// fixturePath is the single sanitized --data fixture every bundled theme
5555
// renders against - see the package comment above for why one shared fixture
56-
// replaces what used to be 124 per-theme files.
56+
// replaces what used to be 125 per-theme files.
5757
var fixturePath = filepath.Join("testdata", "fixtures", "prompt.data.json")
5858

5959
// sanitizedPWD is the PWD value cli/sanitize.go bakes into fixturePath (see
@@ -69,7 +69,7 @@ var update = flag.Bool("update", false, "regenerate the golden manifest and repr
6969
// fixture. code.yml runs `go test ./...` on ubuntu, macOS and windows, so all
7070
// three matter, not just this machine.
7171
func TestMain(m *testing.M) {
72-
// 65 of 124 themes render a time segment through dateInZone(fmt, date,
72+
// 65 of 125 themes render a time segment through dateInZone(fmt, date,
7373
// "Local") (template/date.go). The segment's own state is baked into the
7474
// fixture at record time (restoreData never re-probes it), but formatting
7575
// that recorded instant still happens at render time in the process's
@@ -216,7 +216,7 @@ func renderTheme(t *testing.T, themePath, fixturePath string) []byte {
216216
// template.Init only rebuilds the package-level template.Cache singleton
217217
// when it is nil (template/init.go) - by design, for the serve daemon,
218218
// which stays alive across many renders and calls ResetCache itself
219-
// between them (cli/serve.go). This harness renders 124 different themes
219+
// between them (cli/serve.go). This harness renders 125 different themes
220220
// (each with its own env identity) in one process, and other tests in
221221
// this package also populate Cache directly, so without forcing a rebuild
222222
// here every render after the first would silently reuse whichever env
@@ -314,13 +314,13 @@ func contextWindow(b []byte, offset int) []byte {
314314
}
315315

316316
// TestGoldenThemes renders every bundled theme from its committed fixture and
317-
// checks it two ways: a sha256 line in the manifest (all 124 themes) and,
317+
// checks it two ways: a sha256 line in the manifest (all 125 themes) and,
318318
// additionally for representativeThemes, a byte-for-byte comparison against a
319319
// committed golden file. Run with -update to regenerate both instead of
320320
// comparing.
321321
func TestGoldenThemes(t *testing.T) {
322322
themePaths := themeFiles(t)
323-
require.Lenf(t, themePaths, 124, "expected 124 bundled themes (122 .omp.json + 2 .omp.yaml); "+
323+
require.Lenf(t, themePaths, 125, "expected 125 bundled themes (123 .omp.json + 2 .omp.yaml); "+
324324
"if this changed intentionally, update the fixture/golden set for the new/removed theme(s)")
325325

326326
type manifestEntry struct {

src/prompt/testdata/goldens/manifest.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if_tea 1485171bfd8dc7ed6c8741682d96b434075286345a7e493ece046180f276ba6d
5151
illusi0n 136fcbf744b7423de9326452b336b9c85e7edc2888821a166939019f41d24c5f
5252
iterm2 39e7436753c8cdae446cd25670bd3f33e11a807720d1f01047f3e724debb679d
5353
jandedobbeleer 28dc389e8d6265370039f2c749559e181a659d35272aebfc8a1120dc1ed4443d
54+
jandedobbeleer-accessible d6f8430dbe8df92601134d90ebd6a5838dfe0bb3d91e13def35d7d0e86a530b1
5455
jblab_2021 72923b996d17e9502f0cc5d182eebc64948eac132fdbf767e6f520ea9a415556
5556
jonnychipz 4a5ef8a7154c7c3c237e387d8d03858ff59b942b937c232fabd23ec419c9efc0
5657
json f8a1ebf6f791cb08a142718cf2ad34e338f562584d59655c903064458244efa3

src/shell/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ else
3333
os.execute(string.format('"%s" notice', omp_executable))
3434
end`
3535
case Streaming:
36-
return "serve_enabled = true"
36+
return "if os.getenv(\"POSH_DISABLE_STREAMING\") == nil then\n serve_enabled = true\nend"
3737
case PromptMark, PoshGit, Azure, LineError, Jobs, CursorPositioning, Async, KeyHandlers, VIMode:
3838
fallthrough
3939
default:

src/shell/cmd_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ else
2727
os.execute(string.format('"%s" notice', omp_executable))
2828
end
2929
rprompt_enabled = true
30-
serve_enabled = true`
30+
if os.getenv("POSH_DISABLE_STREAMING") == nil then
31+
serve_enabled = true
32+
end`
3133

3234
assert.Equal(t, want, got)
3335
}

src/shell/fish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (f Features) Fish() Code {
2424
case Tooltips:
2525
return "enable_poshtooltips"
2626
case Streaming:
27-
return "set --global _omp_enable_streaming 1"
27+
return "if not set -q POSH_DISABLE_STREAMING; set --global _omp_enable_streaming 1; end"
2828
case Upgrade:
2929
return unixUpgrade
3030
case Notice:

0 commit comments

Comments
 (0)