Fix ratatui-image tmux detection when used with a configured image protocol (#352)

This commit is contained in:
Nemo157 2024-09-17 07:12:16 +02:00 committed by GitHub
parent f4492c9f77
commit e40a8a8d2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1276,10 +1276,12 @@ fn picker_from_termios(protocol_type: Option<ProtocolType>) -> Option<Picker> {
},
};
// `guess_protocol` also does tmux detection,
// run it always then overwrite the guessed protocol if needed
picker.guess_protocol();
if let Some(protocol_type) = protocol_type {
picker.protocol_type = protocol_type;
} else {
picker.guess_protocol();
}
Some(picker)