warpdotdev / warpdotdev/warp

Input to the prompt is not delivered as-is

Open
#3,881 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:shell-terminal bug ready-to-implement triaged
Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

Discord username (optional)

yj_kwon

Describe the bug

When I copy & paste long command to the prompt and run, the command I input is not delivered to the system correctly.

To reproduce
  1. Copy & paste following code to the prompt and run.
echo '
{
    "OTA_AirLowFareSearchRQ": {
        "Version": "4",
        "POS": {
            "Source": [
                {
                    "PseudoCityCode": "NL98",
                    "RequestorID": {
                        "Type": "1",
                        "ID": "1",
                        "CompanyName": {
                            "Code": "TN",
                            "content": "TN"
                        }
                    }
                }
            ]
        },
        "OriginDestinationInformation": [
            {
                "RPH": "1",
                "DepartureDates":{
                    "DaysRange":[
                        {
                        "FromDate":"2023-12-01",
                        "ToDate":"2023-12-15"
                        }
                    ]
                },
                "OriginLocation": {
                    "LocationCode": "SEL"
                },
                "DestinationLocation": {
                    "LocationCode": "LAX"
                }
            },
             {
                "RPH": "2",
                "DepartureDates":{
                    "DaysRange":[
                        {
                        "FromDate":"2024-01-01",
                        "ToDate":"2024-01-15"
                        }
                    ]
                },
                "OriginLocation": {
                    "LocationCode": "LAX"
                },
                "DestinationLocation": {
                    "LocationCode": "SEL"
                }
            }
        ],
        "TravelPreferences": {
            "ValidInterlineTicket": true,
            "FlightTypePref": {
                "MaxConnections": "1"
            },
            "TPA_Extensions": {
                "DataSources": {
                    "NDC": "Disable",
                    "ATPCO": "Enable",
                    "LCC": "Disable"
                },
                "TripType": {
                    "Value": "OneWay"
                },
                "LongConnectTime": {
                    "Enable": true
                },
                
                "DiversityParameters": {
                    "AdditionalNonStopsPercentage": 10
                }
            }
        },
        "TravelerInfoSummary": {
            "SeatsRequested": [
                1
            ],
            "AirTravelerAvail": [
                {
                    "PassengerTypeQuantity": [
                        {
                            "Code": "ADT",
                            "Quantity": 1
                        }
                    ]
                }
            ]
        },
        "TPA_Extensions": {
            "IntelliSellTransaction": {
                "RequestType": {
                    "Name": "AD7"
                }
            }
        }
    }
}' > text.json
  1. Then check the text.json result.

Sometimes the result is the same as input, but sometime the part of inputs in text.json are weirdly manipulated.
It occurs randomly, not always. (It seems like some kind of buffer overflow.)

Check "LocationCod part to see how it is manipulated. (When this weird manipulation happened, results are always different)

{
    "OTA_AirLowFareSearchRQ": {
        "Version": "4",
        "POS": {
            "Source": [
                {
                    "PseudoCityCode": "NL98",
                    "RequestorID": {
                        "Type": "1",
                        "ID": "1",
                        "CompanyName": {
                            "Code": "TN",
                            "content": "TN"
                        }
                    }
                }
            ]
        },
        ,
        "OriginDestinationInformation": [
            {
                "RPH": "1",
                "DepartureDates":{
                    "DaysRange":[
                        {
                        "FromDate":"2023-12-01",
                        "ToDate":"2023-12-15"
                        }
                    ]
                },
                "OriginLocation": {
                    "LocationCode": "SEL"
                },
                "DestinationLocation": {
                    "LocationCode": "LAX"
                }
            },
             {
                "RPH": "2",
                "DepartureDates":{
                    "DaysRange":[
                        {
                        "FromDate":"2024-01-01",
                        "ToDate":"2024-01-15"
                        }
                    ]
                },
                "OriginLocation": {
                    "LocationCode": "LAX"
                },
                "DestinationLocation": {
                    "LocationCod                          }
            }
        ],
        "TravelPreferences": {
            "ValidInterlineTicket": true,
            "FlightTypePref": {
                "MaxConnections": "1"
            },
            "TPA_Extensions": {
                "DataSources": {
                    "NDC": "Disable",
                    "ATPCO": "Enable",
                    "LCC": "Disable"
                },
                "TripType": {
                    "Value": "OneWay"
                },
                "LongConnectTime": {
                    "Enable": true
                },
                
                "DiversityParameters": {
                    "AdditionalNonStopsPercentage": 10
                }
            }
        },
        "TravelerInfoSummary": {
            "SeatsRequested": [
                1
            ],
            "AirTravelerAvail": [
                {
                    "PassengerTypeQuant                                {
                            "Code": "ADT",
                            "Quantity": 1
                        }
                    ]
                }
            ]
        },
        "TPA_Extensions": {
            "IntelliSellTransaction": {
                "RequestType": {
                    "Name": "AD7"
                }
            }
        }
    }
}
Expected behavior

The command I input to the prompt should be delivered to the system as-is

Screenshots

No response

Operating system

MacOS

Operating system and version

13.5

Shell Version

GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)

Current Warp version

v0.2023.11.14.08.02.stable_02

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified. Reproduce the issue in Warp on macOS with GNU bash by pasting the provided long command, then compare the resulting text.json with the input and check whether corruption is reproducible. Done means the command reaches the system and is written to text.json exactly as pasted.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, macos, rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.