Skip to content

Commit

Permalink
Explicitly save the position before entering the alternate screen
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoheiu committed Feb 2, 2024
1 parent 7296e1e commit af47ad9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::session::*;
use super::state::*;
use super::term::*;

use crossterm::cursor::RestorePosition;
use crossterm::cursor::{RestorePosition, SavePosition};
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use crossterm::execute;
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
Expand Down Expand Up @@ -155,6 +155,7 @@ pub fn run(arg: PathBuf, log: bool) -> Result<(), FxError> {
fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
//Enter the alternate screen with crossterm
let mut screen = stdout();
write!(screen, "{}", SavePosition)?;
enter_raw_mode();
execute!(screen, EnterAlternateScreen)?;

Expand Down

0 comments on commit af47ad9

Please sign in to comment.