File tree Expand file tree Collapse file tree 6 files changed +8
-8
lines changed
Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ workspace = true
1818[dependencies ]
1919bitflags.workspace = true
2020camino.workspace = true
21+ fig_os_shim.workspace = true
2122serde.workspace = true
2223serde_yaml = " 0.9"
2324shell-color.workspace = true
Original file line number Diff line number Diff line change @@ -833,8 +833,7 @@ impl<T> Term<T> {
833833 trace ! ( "New command cursor: {:?}" , self . shell_state. cmd_cursor) ;
834834
835835 // Add work around for emojis
836- if let Ok ( cursor_offset) = std:: env:: var ( "Q_PROMPT_OFFSET_WORKAROUND" ) {
837- // ALLOWED: alacritty_terminal doesn't have fig_os_shim dependency
836+ if let Ok ( cursor_offset) = fig_os_shim:: Env :: new ( ) . q_prompt_offset_workaround ( ) {
838837 if let Ok ( offset) = cursor_offset. parse :: < i32 > ( ) {
839838 self . shell_state . cmd_cursor = self . shell_state . cmd_cursor . map ( |cursor| Point {
840839 column : Column ( ( cursor. column . 0 as i32 - offset) . max ( 0 ) as usize ) ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ aws-types.workspace = true
2727bytes.workspace = true
2828fig_auth.workspace = true
2929fig_aws_common.workspace = true
30+ fig_os_shim.workspace = true
3031fig_request.workspace = true
3132fig_settings.workspace = true
3233fig_util.workspace = true
Original file line number Diff line number Diff line change @@ -58,10 +58,7 @@ pub struct StreamingClient {
5858
5959impl StreamingClient {
6060 pub async fn new ( ) -> Result < Self , Error > {
61- let client = if fig_util:: system_info:: in_cloudshell ( )
62- || std:: env:: var ( "Q_USE_SENDMESSAGE" ) . is_ok_and ( |v| !v. is_empty ( ) )
63- {
64- // ALLOWED: fig_api_client doesn't have fig_os_shim dependency
61+ let client = if fig_util:: system_info:: in_cloudshell ( ) || fig_os_shim:: Env :: new ( ) . q_use_sendmessage ( ) {
6562 Self :: new_qdeveloper_client ( & Endpoint :: load_q ( ) ) . await ?
6663 } else {
6764 Self :: new_codewhisperer_client ( & Endpoint :: load_codewhisperer ( ) ) . await
Original file line number Diff line number Diff line change @@ -282,12 +282,12 @@ pub fn in_cloudshell() -> bool {
282282
283283pub fn in_codespaces ( ) -> bool {
284284 static IN_CODESPACES : OnceLock < bool > = OnceLock :: new ( ) ;
285- * IN_CODESPACES . get_or_init ( || std :: env :: var_os ( "CODESPACES" ) . is_some ( ) || fig_os_shim:: Env :: new ( ) . in_codespaces ( ) )
285+ * IN_CODESPACES . get_or_init ( || fig_os_shim:: Env :: new ( ) . in_codespaces ( ) )
286286}
287287
288288pub fn in_ci ( ) -> bool {
289289 static IN_CI : OnceLock < bool > = OnceLock :: new ( ) ;
290- * IN_CI . get_or_init ( || std :: env :: var_os ( "CI" ) . is_some ( ) || fig_os_shim:: Env :: new ( ) . in_ci ( ) )
290+ * IN_CI . get_or_init ( || fig_os_shim:: Env :: new ( ) . in_ci ( ) )
291291}
292292
293293#[ cfg( target_os = "macos" ) ]
You can’t perform that action at this time.
0 commit comments