Skip to content

cleanup osc calls for shell_integration#12810

Merged
fdncred merged 2 commits intonushell:mainfrom
fdncred:cleanup_osc_calls
May 8, 2024
Merged

cleanup osc calls for shell_integration#12810
fdncred merged 2 commits intonushell:mainfrom
fdncred:cleanup_osc_calls

Conversation

@fdncred
Copy link
Copy Markdown
Contributor

@fdncred fdncred commented May 8, 2024

Description

This PR is a continuation of #12629 and meant to address Reilly's stated issue.

With this PR, nushell should work more consistently with WezTerm on Windows. However, that means continued scrolling with typing if osc133 is enabled. If it's possible to run WezTerm inside of vscode, then having osc633 enabled will also cause the display to scroll with every character typed. I think the cause of this is that reedline paints the entire prompt on each character typed. We need to figure out how to fix that, but that's in reedline.

For my purposes, I keep osc133 and osc633 set to true and don't use WezTerm on Windows.

Thanks @rgwood for reporting the issue. I found several logic errors. It's often good to come back to PRs and look at them with fresh eyes. I think this is pretty close to logically correct now. However, I'm approaching burn out on ansi escape codes so i could've missed something.

Kudos to escape-artist for helping me debug an ansi escape codes that are actually being sent to the terminal. It was an invaluable tool.

User-Facing Changes

Tests + Formatting

After Submitting

@fdncred fdncred merged commit 5466da3 into nushell:main May 8, 2024
@fdncred fdncred deleted the cleanup_osc_calls branch May 8, 2024 18:34
@hustcer hustcer added this to the v0.94.0 milestone May 9, 2024
@rgwood
Copy link
Copy Markdown
Contributor

rgwood commented May 9, 2024

As you noted, after this PR osc133: true breaks Windows WezTerm (before it was osc633: true).

(not saying that's an issue with your PR, it's likely a WezTerm one, just writing it down for future investigation)

@fdncred
Copy link
Copy Markdown
Contributor Author

fdncred commented May 9, 2024

As you noted, after this PR osc133: true breaks Windows WezTerm (before it was osc633: true).

(not saying that's an issue with your PR, it's likely a WezTerm one, just writing it down for future investigation)

Agreed. To say here what I've said in other places. I think this problem with WezTerm is related to how reedline redraws the entire prompt with every character typed in the repl. I'm not sure why. I've looked and haven't found it yet. It could also be a bug in WezTerm but I kind of doubt that after seeing how many escapes we send.

The good news at least is that now you can turn off osc133 and still have the rest of the ansi escapes. Prior to these two PRs you weren't able to do that.

FilipAndersson245 pushed a commit to FilipAndersson245/nushell that referenced this pull request May 18, 2024
# Description

This PR is a continuation of nushell#12629 and meant to address [Reilly's
stated
issue](nushell#12629 (comment)).

With this PR, nushell should work more consistently with WezTerm on
Windows. However, that means continued scrolling with typing if osc133
is enabled. If it's possible to run WezTerm inside of vscode, then
having osc633 enabled will also cause the display to scroll with every
character typed. I think the cause of this is that reedline paints the
entire prompt on each character typed. We need to figure out how to fix
that, but that's in reedline.

For my purposes, I keep osc133 and osc633 set to true and don't use
WezTerm on Windows.

Thanks @rgwood for reporting the issue. I found several logic errors.
It's often good to come back to PRs and look at them with fresh eyes. I
think this is pretty close to logically correct now. However, I'm
approaching burn out on ansi escape codes so i could've missed
something.

Kudos to [escape-artist](https://github.com/rgwood/escape-artist) for
helping me debug an ansi escape codes that are actually being sent to
the terminal. It was an invaluable tool.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants