Thank you all for the thoughtful replies. They help a lot.
Some of you asked why I choose to pursue a CS master. Frankly speaking, I did this purely for the fast-growing job market and high salaries of CS related careers. Before attending the graduate school, I thought I could overcome the pain of studying CS and forget about history. But after spending one year on coding, I just found it is not that easy to wipe my interest of history and sociology. So I am kind of in a dilemma right now. I have already spent a lot of time & money on this CS program. Meanwhile, I assume it may be harder for me to apply for history PhD/Masters as a CS graduate. I think staying at my current program for now and looking for potential opportunities after graduation may be a feasible solution. However, is it possible for me to work for a few years and then do the applications? My undergraduate and graduate school have costed my parents nearly half millions of dollars and I don't want to ask for their money after graduation.